Просмотр исходного кода

Fix null dereference infer warnings

Ryan Olson (IG) лет назад: 7
Родитель
Сommit
cf9bd2335b

+ 1 - 1
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -838,7 +838,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 {
 {
     if (self.presentedViewController) {
     if (self.presentedViewController) {
         [self resignKeyAndDismissViewControllerAnimated:YES completion:completion];
         [self resignKeyAndDismissViewControllerAnimated:YES completion:completion];
-    } else {
+    } else if (future) {
         [self makeKeyAndPresentViewController:future() animated:YES completion:completion];
         [self makeKeyAndPresentViewController:future() animated:YES completion:completion];
     }
     }
 }
 }

+ 4 - 2
Classes/GlobalStateExplorers/FLEXFileBrowserTableViewController.m

@@ -332,8 +332,10 @@
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
     NSString *fullPath = [self filePathAtIndexPath:indexPath];
 
 
-    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[fullPath] applicationActivities:nil];
-    [self presentViewController:activityViewController animated:true completion:nil];
+    if (fullPath != nil) {
+        UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[fullPath] applicationActivities:nil];
+        [self presentViewController:activityViewController animated:true completion:nil];
+    }
 }
 }
 
 
 - (void)reloadDisplayedPaths
 - (void)reloadDisplayedPaths