uber / rides-ios-sdk

Uber Rides iOS SDK (beta)
https://developer.uber.com/docs
MIT License
374 stars 124 forks source link

Crash bug when processing SSO return under Xcode 9.3 #233

Closed lhasiuk closed 6 years ago

lhasiuk commented 6 years ago

Fixed an issue that appears when compiled with Xcode 9.3, where the various "annotation" parameters are declared as "Any", which means that they cannot be nil. With the new version of the compiler, a nil value causes a runtime crash, and the source of this parameter, the application's incoming value for options[UIApplicationOpenURLOptionsAnnotationKey] is typically nil. Passing a nil value as annotation directly actually results in the following compilation error: "Null passed to a callee that requires a non-null argument", as further evidence of the issue. The fix is to make annotation an optional parameter ("Any?" instead of "Any") in the various places it is used.

lhasiuk commented 6 years ago

Sorry about yesterday's pull request... I hadn't checked the test code to make sure it compiled. Today's fixes that and catches a few more places where "annotation" was required to be non-nil.

edjiang commented 6 years ago

No problem, thanks @lhasiuk!

martyla commented 6 years ago

Any blockers on merging this?

edjiang commented 6 years ago

No blockers -- just my time. Sorry! 😅

I'll bump the version later today.