From b773717d1a290a2f2920cc2f8f94976ba0b60329 Mon Sep 17 00:00:00 2001 From: Bilal Syed Date: Mon, 9 Jul 2018 22:48:55 +0300 Subject: [PATCH] [iOS] Fix crash at unknown firebase url --- ios/RNFirebase/links/RNFirebaseLinks.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/RNFirebase/links/RNFirebaseLinks.m b/ios/RNFirebase/links/RNFirebaseLinks.m index db3a94ea..8ed42677 100644 --- a/ios/RNFirebase/links/RNFirebaseLinks.m +++ b/ios/RNFirebase/links/RNFirebaseLinks.m @@ -60,11 +60,11 @@ continueUserActivity:(NSUserActivity *)userActivity return [[FIRDynamicLinks dynamicLinks] handleUniversalLink:userActivity.webpageURL completion:^(FIRDynamicLink * _Nullable dynamicLink, NSError * _Nullable error) { - if (error != nil){ - NSLog(@"Failed to handle universal link: %@", [error localizedDescription]); - } else { - NSURL* url = dynamicLink ? dynamicLink.url : userActivity.webpageURL; + if (dynamicLink && dynamicLink.url) { + NSURL* url = dynamicLink.url; [self sendJSEvent:self name:LINKS_LINK_RECEIVED body:url.absoluteString]; + } else { + NSLog(@"Failed to handle universal link: %@", userActivity.webpageURL); } }]; }