From 8c8b2dbc1991043e6b310714ca372f9049bd7209 Mon Sep 17 00:00:00 2001
From: Eric Petit <eric@lapsus.org>
Date: Tue, 31 Jan 2006 04:19:31 +0000
Subject: [PATCH]  Fixes crash when the user is always asked for the download
 location

---
 macosx/NameCell.m | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/macosx/NameCell.m b/macosx/NameCell.m
index 9af470fab..35150cd3f 100644
--- a/macosx/NameCell.m
+++ b/macosx/NameCell.m
@@ -34,9 +34,15 @@
     fSizeString  = [NSString stringWithFormat: @" (%@)",
                     [NSString stringForFileSize: stat->info.totalSize]];
 
-    fIcon = [[NSWorkspace sharedWorkspace] iconForFile:
-                [[NSString stringWithUTF8String: stat->folder]
-                stringByAppendingPathComponent: fNameString]];                  
+    if( stat->folder )
+        fIcon = [[NSWorkspace sharedWorkspace] iconForFile:
+                    [[NSString stringWithUTF8String: stat->folder]
+                    stringByAppendingPathComponent: fNameString]];
+    else
+        /* XXX The torrent is still being opened, the destination hasn't
+           been chosen yet. It shouldn't be added to the table view so
+           soon */
+        fIcon = [[NSWorkspace sharedWorkspace] iconForFile: @"/System"];
     [fIcon setFlipped: YES];
 
     fTimeString  = @"";