Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
168 stars 140 forks source link

Crash when News Feed card URL is nil #192

Closed J-Mendes closed 5 years ago

J-Mendes commented 5 years ago

Hi,

Recently I've been receiving reports from the crash analysis tool that says when a card on NewsFeed has no url the Appboy SDK is crashing internally (Invalid parameter not satisfying: url != nil). I've seen that this only affects users with iOS 13.0 which might be related with that be a beta version. From a code analysis on ABKUIURLUtils.m it seems that this might be easily prevented by doing a nil checking before open the url. Below I give you the stack trace generated by the issue to help you see what happen.

Fatal Exception: NSInternalInconsistencyException Invalid parameter not satisfying: url != nil 0 CoreFoundation 0x1bdf729f0 __exceptionPreprocess 1 libobjc.A.dylib 0x1be47f4fc objc_exception_throw 2 CoreFoundation 0x1bde75fec +[_CFXNotificationTokenRegistration keyCallbacks] 3 Foundation 0x1bdaf8330 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4 CoreServices 0x1bf748b58 -[LSApplicationWorkspace openURL:configuration:completionHandler:] 5 UIKitCore 0x1c5bbd558 -[UIApplication _openURL:options:openApplicationEndpoint:completionHandler:] 6 UIKitCore 0x1c5bbd2f4 -[UIApplication openURL:options:completionHandler:] 7 Appboy_iOS_SDK 0x105559628 +[ABKUIURLUtils openURL:] + 53 (ABKUIURLUtils.m:53) 8 Appboy_iOS_SDK 0x105559520 +[ABKUIURLUtils openURLWithSystem:] + 47 (ABKUIURLUtils.m:47) 9 Appboy_iOS_SDK 0x105555a4c -[ABKNewsFeedTableViewController handleCardClick:] + 211 (ABKNewsFeedTableViewController.m:211) 10 Appboy_iOS_SDK 0x105555950 -[ABKNewsFeedTableViewController tableView:didSelectRowAtIndexPath:] + 198 (ABKNewsFeedTableViewController.m:198) 11 UIKitCore 0x1c5d762f8 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] 12 UIKitCore 0x1c5d76514 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] 13 UIKitCore 0x1c5bc02a4 _runAfterCACommitDeferredBlocks 14 UIKitCore 0x1c5bb077c _cleanUpAfterCAFlushAndRunDeferredBlocks 15 UIKitCore 0x1c5bdf668 _afterCACommitHandler 16 CoreFoundation 0x1bdeefb24 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION 17 CoreFoundation 0x1bdeeaa24 CFRunLoopDoObservers 18 CoreFoundation 0x1bdeeaff0 CFRunLoopRun 19 CoreFoundation 0x1bdeea7ac CFRunLoopRunSpecific 20 GraphicsServices 0x1bd0ec180 GSEventRunModal 21 UIKitCore 0x1c5bb7244 UIApplicationMain 22 App 0x104732ce4 main + 22 23 libdyld.dylib 0x1be440e7c start

Info Value
Platform Name ios
Platform Version 13.0
SDK Version 3.14.0
Integration Method segment
Xcode Version Xcode 10.2.1
Repro rate all the time (100%)
jordangustafson commented 5 years ago

I am seeing this same crash as well for users on the iOS 13 beta

jordangustafson commented 5 years ago

I am seeing this same crash as well for users on the iOS 13 beta

This appears to be resolved with iOS 13 Beta 3

hokstuff commented 5 years ago

Closing out this issue as per the comment above. Thanks for the investigation @JordanRGustafson! Let us know if it comes up again.