alex-alex/iOS-Ingress — pull request #320 by alistairmcmillan (2013-06-30 02:46:56+00:00)
Title: Fix for startup crash after signing in

To duplicate crash (tested on iPhone 4, iPad mini and simulator):
1. Remove game from simulator or device (which automatically removes
related data ensuring next startup is from scratch)
2. Re-install
3. Start game and log in at the Google prompt
4. App crashes immediately

Sample crash log:
Date/Time: 2013-06-29 12:50:15.308 +0100
OS Version: iOS 6.1.3 (10B329)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xfffffffc
Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 UIKit	0x336f813c -[UITableViewRowData
rectForRow:inSection:] + 564
1 UIKit	0x33715914 -[UITableView
rectForRowAtIndexPath:] + 108
2 UIKit	0x33808032 -[UITableView
_contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2482
3 UIKit	0x33807652 -[UITableView
scrollToRowAtIndexPath:atScrollPosition:animated:] + 34
4 Ingress	0x000454fc -[CommTableViewController
refresh] (CommTableViewController.m:52)
5 Ingress	0x00043f9c -[CommViewController
viewDidLoad] (CommViewController.m:35)
6 UIKit	0x336e6590 -[UIViewController
loadViewIfRequired] + 360
7 Ingress	0x0001bed2 -[ScannerViewController
viewDidLoad] (ScannerViewController.m:93)
8 UIKit	0x336e6590 -[UIViewController
loadViewIfRequired] + 360
9 UIKit	0x3377234e -[UIViewController
shouldAutorotate] + 22
10 UIKit	0x337b3d0c -[UIWindowController
transition:fromViewController:toViewController:target:didEndSelector:]
+ 1580
11 UIKit	0x337b2fe2 -[UIViewController
presentViewController:withTransition:completion:] + 3390
12 UIKit	0x338d53ea -[UIViewController
presentModalViewController:animated:] + 26
13 libdispatch.dylib	0x3997c11c
_dispatch_call_block_and_release + 8
14 libdispatch.dylib	0x399899b6
_dispatch_after_timer_callback + 10
15 libdispatch.dylib	0x3997b4b4 _dispatch_client_callout
+ 20
16 libdispatch.dylib	0x3997bf88
_dispatch_source_invoke$VARIANT$up + 244
17 libdispatch.dylib	0x3997cd8a
_dispatch_main_queue_callback_4CF$VARIANT$up + 162
18 CoreFoundation	0x31892f36 __CFRunLoopRun + 1286
19 CoreFoundation	0x31805eb8 CFRunLoopRunSpecific + 352
20 CoreFoundation	0x31805d44 CFRunLoopRunInMode + 100
21 GraphicsServices	0x353c92e6 GSEventRunModal + 70
22 UIKit	0x3371b2fc UIApplicationMain + 1116
23 Ingress	0x0001ac52 main (main.m:14)
24 libdyld.dylib	0x3999bb1c start + 0

Issue is that scrollToRowAtIndexPath is being called initially with
scrollIndexPath.row set to -1.