Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Crash in setUserLocationVerticalAlignment #5274

Closed
picciano opened this issue Jun 7, 2016 · 0 comments · Fixed by #5278
Closed

Crash in setUserLocationVerticalAlignment #5274

picciano opened this issue Jun 7, 2016 · 0 comments · Fixed by #5278
Labels
crash iOS Mapbox Maps SDK for iOS
Milestone

Comments

@picciano
Copy link

picciano commented Jun 7, 2016

Platform: iOS
Mapbox SDK version: ios-v3.2.2 (abe1695)

Steps to trigger behavior

  1. Launch app with map
  2. In viewWillAppear call [self.mapView setUserLocationVerticalAlignment:MGLAnnotationVerticalAlignmentCenter animated:NO];

Expected behavior

App does not crash.

Actual behavior

App occasionally crashes. I think an array of locations is being created at line 3899 and self.userLocation.location is nil.
[self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location] animated:animated];

Stack trace

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18385adb0 __exceptionPreprocess
1  libobjc.A.dylib                0x182ebff80 objc_exception_throw
2  CoreFoundation                 0x18373e1a0 -[__NSPlaceholderArray initWithObjects:count:]
3  CoreFoundation                 0x183749c48 +[NSArray arrayWithObjects:count:]
4  Mapbox                         0x100621560 -[MGLMapView setUserLocationVerticalAlignment:animated:]
5  TallyGo                        0x100188530 -[TGMainViewController viewWillAppear:] (TGMainViewController.m:194)
6  UIKit                          0x1889d1374 -[UIViewController _setViewAppearState:isAnimating:]
7  UIKit                          0x1889d10e8 -[UIViewController __viewWillAppear:]
8  UIKit                          0x188b6be5c -[UINavigationController _startCustomTransition:]
9  UIKit                          0x188a77e40 -[UINavigationController _startDeferredTransitionIfNeeded:]
10 UIKit                          0x188a77b1c -[UINavigationController __viewWillLayoutSubviews]
11 UIKit                          0x188a77a84 -[UILayoutContainerView layoutSubviews]
12 UIKit                          0x1889b41e4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
13 QuartzCore                     0x186346994 -[CALayer layoutSublayers]
14 QuartzCore                     0x1863415d0 CA::Layer::layout_if_needed(CA::Transaction*)
15 QuartzCore                     0x186341490 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
16 QuartzCore                     0x186340ac0 CA::Context::commit_transaction(CA::Transaction*)
17 QuartzCore                     0x186340820 CA::Transaction::commit()
18 QuartzCore                     0x186339de4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
19 CoreFoundation                 0x183810728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
20 CoreFoundation                 0x18380e4cc __CFRunLoopDoObservers
21 CoreFoundation                 0x18380e8fc __CFRunLoopRun
22 CoreFoundation                 0x183738c50 CFRunLoopRunSpecific
23 GraphicsServices               0x185020088 GSEventRunModal
24 UIKit                          0x188a22088 UIApplicationMain
25 TallyGo                        0x1001876c4 main (main.m:14)
26 libdispatch.dylib              0x1832d68b8 (Missing)
@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS crash labels Jun 7, 2016
1ec5 added a commit that referenced this issue Jun 7, 2016
Avoid creating an array with nil.

Fixes #5274.
@1ec5 1ec5 closed this as completed in #5278 Jun 7, 2016
1ec5 added a commit that referenced this issue Jun 7, 2016
* [ios] Fixed crash in userLocationVerticalAlignment

Avoid creating an array with nil.

Fixes #5274.

* [ios] Fixed analyzer warning

Fixed a write-without-read analyzer warning introduced in #5235.
@1ec5 1ec5 added this to the ios-v3.3.0 milestone Jun 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants