alex-alex/iOS-Ingress — pull request #321 by alistairmcmillan (2013-06-30 02:47:16+00:00)
Title: Fix for Portal Recharge crash

To duplicate the crash:

1. Select a remote portal
2. Click Recharge
3. Crash

Example crash log:

Date/Time: 2013-06-30 01:55:01.209 +0100
OS Version: iOS 6.1.3 (10B329)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0

Last Exception Backtrace:
0 CoreFoundation	0x33ac129e __exceptionPreprocess +
158
1 libobjc.A.dylib	0x3b96c97a objc_exception_throw + 26
2 CoreFoundation	0x33a1255a
-[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 130
3 CoreFoundation	0x33a490ce +[NSDictionary
dictionaryWithObjects:forKeys:count:] + 46
4 Ingress	0x001032f8 -[API
remoteRechargePortal:portalKey:completionHandler:] (API.m:1188)
5 Ingress	0x00134268
-[PortalActionsViewController recharge:]
(PortalActionsViewController.m:426)
6 UIKit	0x359b40c0 -[UIApplication
sendAction:to:from:forEvent:] + 68
7 UIKit	0x359b4072 -[UIApplication
sendAction:toTarget:fromSender:forEvent:] + 26
8 UIKit	0x359b4050 -[UIControl
sendAction:to:forEvent:] + 40
9 UIKit	0x359b3906 -[UIControl(Internal)
_sendActionsForEvents:withEvent:] + 498
10 UIKit	0x359b3dfc -[UIControl
touchesEnded:withEvent:] + 484
11 UIKit	0x358d241c
_UIGestureRecognizerUpdate + 5764
12 CoreFoundation	0x33a966c8
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
13 CoreFoundation	0x33a949bc __CFRunLoopDoObservers +
272
14 CoreFoundation	0x33a94d12 __CFRunLoopRun + 738
15 CoreFoundation	0x33a07eb8 CFRunLoopRunSpecific + 352
16 CoreFoundation	0x33a07d44 CFRunLoopRunInMode + 100
17 GraphicsServices	0x375d32e6 GSEventRunModal + 70
18 UIKit	0x3591d2fc UIApplicationMain + 1116
19 Ingress	0x000e4242 main (main.m:14)
20 libdyld.dylib	0x3bda3b1c start + 0

Issue is caused by [[API sharedInstance]
remoteRechargePortal:self.portal portalKey:_portalKey
completionHandler:handler]; being called with _portalKey being null.