]> granicus.if.org Git - transmission/commitdiff
don't try to reveal files that don't exist
authorMitchell Livingston <livings124@transmissionbt.com>
Wed, 21 Oct 2009 22:15:36 +0000 (22:15 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Wed, 21 Oct 2009 22:15:36 +0000 (22:15 +0000)
macosx/Controller.m
macosx/FileOutlineController.m
macosx/InfoWindowController.m

index 374514e6b558adf5f425a10ddaea38d4022bda10..d6e1259e8c9c04b1b0a60e446f1951ceca11282a 100644 (file)
@@ -1473,7 +1473,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
                 [paths addObject: [NSURL fileURLWithPath: location]];
         }
         
-        [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
+        if ([paths count] > 0)
+            [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
     }
     else
     {
index 9bf1adbde879ee082adabe04b748c31c6311d9d3..838f4ae3c8adbc988e40b10db2544c77c7f317be 100644 (file)
@@ -325,7 +325,8 @@ typedef enum
                 [paths addObject: [NSURL fileURLWithPath: path]];
         }
         
-        [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
+        if ([paths count])
+            [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
     }
     else
     {
index 5fc624d06d0786acc2afe674558764217edd5281..36a946eace7eb9c59e080f3710b4437af3ca7a7b 100644 (file)
@@ -1209,13 +1209,17 @@ typedef enum
     if ([fTorrents count] > 0)
     {
         Torrent * torrent = [fTorrents objectAtIndex: 0];
+        NSString * location = [torrent dataLocation];
+        if (!location)
+            return;
+        
         if ([NSApp isOnSnowLeopardOrBetter])
         {
-            NSURL * file = [NSURL fileURLWithPath: [torrent dataLocation]];
+            NSURL * file = [NSURL fileURLWithPath: location];
             [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: [NSArray arrayWithObject: file]];
         }
         else
-            [[NSWorkspace sharedWorkspace] selectFile: [torrent dataLocation] inFileViewerRootedAtPath: nil];
+            [[NSWorkspace sharedWorkspace] selectFile: location inFileViewerRootedAtPath: nil];
     }
 }