ChartsOrg / ChartsOrg/Charts

NSRangeException - index (1) beyond bounds (1)

Open
#4,402 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

* [x] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).

## What did you do?

Crash appeared in our crash reporting. We're using a LineChartView with a single dataset (in the case of the crash) with up to ~ 60 entries.

```
OS Version: iOS 13.3 (17C54)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0

Application Specific Information:
-[UIPinchGestureRecognizer locationOfTouch:inView:]: index (1) beyond bounds (1).

Thread 0 Crashed:
0 CoreFoundation 0x34bf2fa48 __exceptionPreprocess
1 libobjc.A.dylib 0x341a7dfa0 objc_exception_throw
2 CoreFoundation 0x34be251bc +[NSException raise:format:]
3 UIKitCore 0x345892e7c -[UIGestureRecognizer locationOfTouch:inView:]
4 Charts 0x28abf8630 [inlined] UIPinchGestureRecognizer.nsuiLocationOfTouch (Platform+Gestures.swift:84)
5 Charts 0x28abf8630 BarLineChartViewBase.pinchGestureRecognized (BarLineChartViewBase.swift:611)
6 Charts 0x28ac0a5c0 BarLineChartViewBase.pinchGestureRecognized
7 UIKitCore 0x34588962c -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
8 UIKitCore 0x345891d0c _UIGestureRecognizerSendTargetActions
9 UIKitCore 0x34588f4a0 _UIGestureRecognizerSendActions
10 UIKitCore 0x34588ea00 -[UIGestureRecognizer _updateGestureForActiveEvents]
11 UIKitCore 0x345882994 _UIGestureEnvironmentUpdate
12 UIKitCore 0x34588210c -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]
13 UIKitCore 0x345881ed0 -[UIGestureEnvironment _updateForEvent:window:]
14 UIKitCore 0x345cd76f4 -[UIWindow sendEvent:]
15 UIKitCore 0x345cb3e28 -[UIApplication sendEvent:]
16 UIKitCore 0x345d2bfa0 __dispatchPreprocessedEventFromEventQueue
17 UIKitCore 0x345d2e4fc __handleEventQueueInternal
18 UIKitCore 0x345d27370 __handleHIDEventFetcherDrain
19 CoreFoundation 0x34bead9fc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
20 CoreFoundation 0x34bead954 __CFRunLoopDoSource0
21 CoreFoundation 0x34bead0ec __CFRunLoopDoSources0
22 CoreFoundation 0x34bea8238 __CFRunLoopRun
23 CoreFoundation 0x34bea7ad8 CFRunLoopRunSpecific
24 GraphicsServices 0x34bc43324 GSEventRunModal
25 UIKitCore 0x345c9badc UIApplicationMain
26 AppName 0x200d60d94 main (AppDelegate.swift:16)
27 libdyld.dylib 0x350b2935c start
```

## What did you expect to happen?

It should not crash.

## What happened instead?

It crashes.

## Charts Environment

**Charts version/Branch/Commit Number:** 3.5
**Xcode version:** 11.4.1
**Swift version:** 5.2
**Platform(s) running Charts:** iOS

## Demo Project

None available 😞

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.