@@ -142,7 +142,7 @@ @interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit> {
142142@property (assign , nonatomic ) BOOL useCookieBasedMatching;
143143@property (strong , nonatomic ) NSDictionary *deepLinkDebugParams;
144144@property (assign , nonatomic ) BOOL accountForFacebookSDK;
145- @property (assign , nonatomic ) id FBSDKAppLinkUtility;
145+ @property (strong , nonatomic ) id FBSDKAppLinkUtility;
146146@property (assign , nonatomic ) BOOL delayForAppleAds;
147147@property (assign , nonatomic ) BOOL searchAdsDebugMode;
148148@property (strong , nonatomic ) NSMutableArray *whiteListedSchemeList;
@@ -1569,15 +1569,15 @@ - (void)indexOnSpotlightWithBranchUniversalObject:(BranchUniversalObject*)univer
15691569
15701570 if (!universalObject) {
15711571 NSError * error = [NSError branchErrorWithCode: BNCInitError localizedMessage: @" Branch Universal Object is nil" ];
1572- completion (universalObject,nil ,error);
1572+ if (completion) completion (universalObject,nil ,error);
15731573 return ;
15741574 } else {
15751575 [spotlightService indexWithBranchUniversalObject: universalObject
15761576 linkProperties: linkProperties
15771577 callback: ^(BranchUniversalObject * _Nullable universalObject,
15781578 NSString * _Nullable url,
15791579 NSError * _Nullable error) {
1580- completion (universalObject,url,error);
1580+ if (completion) completion (universalObject,url,error);
15811581 }];
15821582 }
15831583}
@@ -1595,8 +1595,7 @@ - (void)indexOnSpotlightUsingSearchableItems:(NSArray<BranchUniversalObject*>* )
15951595 [spotlight indexPrivatelyWithBranchUniversalObjects: universalObjects
15961596 completion: ^(NSArray <BranchUniversalObject *> * _Nullable universalObjects,
15971597 NSError * _Nullable error) {
1598- if (completion)
1599- completion (universalObjects,error);
1598+ if (completion) completion (universalObjects,error);
16001599 }];
16011600}
16021601
@@ -1611,8 +1610,7 @@ - (void)removeSearchableItemWithBranchUniversalObject:(BranchUniversalObject *)u
16111610 andAlias: nil ];
16121611 [spotlight removeSearchableItemsWithIdentifier: dynamicUrl
16131612 callback: ^(NSError * _Nullable error) {
1614- if (completion)
1615- completion (error);
1613+ if (completion) completion (error);
16161614 }];
16171615}
16181616
@@ -1969,10 +1967,12 @@ - (void)insertRequestAtFront:(BNCServerRequest *)req {
19691967}
19701968
19711969static inline void BNCPerformBlockOnMainThreadSync (dispatch_block_t block) {
1972- if ([NSThread isMainThread ]) {
1973- block ();
1974- } else {
1975- dispatch_sync (dispatch_get_main_queue (), block);
1970+ if (block) {
1971+ if ([NSThread isMainThread ]) {
1972+ block ();
1973+ } else {
1974+ dispatch_sync (dispatch_get_main_queue (), block);
1975+ }
19761976 }
19771977}
19781978
0 commit comments