File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,17 @@ - (void)resetAutoReload {
259259}
260260
261261- (void )shareItemTapped : (UIBarButtonItem *)sender {
262- UIActivityViewController *activityViewController = [[UIActivityViewController alloc ] initWithActivityItems: @[[NSURL fileURLWithPath: self .entryPath]] applicationActivities: nil ];
262+ if (!self.entryPath ) {
263+ return ;
264+ }
265+ if (![[NSFileManager defaultManager ] fileExistsAtPath: self .entryPath]) {
266+ return ;
267+ }
268+ NSURL *fileURL = [NSURL fileURLWithPath: self .entryPath];
269+ if (!fileURL) {
270+ return ;
271+ }
272+ UIActivityViewController *activityViewController = [[UIActivityViewController alloc ] initWithActivityItems: @[fileURL] applicationActivities: nil ];
263273 if (@available (iOS 16 , *)) {
264274 activityViewController.popoverPresentationController .sourceItem = sender;
265275 } else {
You can’t perform that action at this time.
0 commit comments