If iPhoto cannot locate the original image file, we won't have a valid
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Sep 2009 20:58:23 +0000 (16:58 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Sep 2009 21:02:00 +0000 (17:02 -0400)
NSData object for the image data. Also, silence the last compiler warning.

iPhoto2Ansel/AnselExportController.m

index 74a70be..90d4c1f 100644 (file)
@@ -589,6 +589,12 @@ NSString * const TURAnselServerPasswordKey = @"password";
         // Read the image into ImageIO (the only API that supports more then just EXIF metadata)
         // Read it into a NSData object first, since we'll need that later on anyway...
         NSData *theImageData = [[NSData alloc] initWithContentsOfFile: [mExportMgr imagePathAtIndex:i]];
+        
+        if (!theImageData) {
+            i++;
+            [theImageData release];
+            continue;
+        }
         source = CGImageSourceCreateWithData((CFDataRef)theImageData, NULL);
         
         // Get the metadata dictionary, cast it to NSDictionary the get a mutable copy of it
@@ -864,14 +870,14 @@ NSString * const TURAnselServerPasswordKey = @"password";
 }
 
 #pragma mark NSTableView Datasource
-- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
 {
     return [anselServers count];
 }
 
 - (id)tableView:(NSTableView *)aTableView
     objectValueForTableColumn:(NSTableColumn *)aTableColumn
-                          row:(int)rowIndex
+                          row:(NSInteger)rowIndex
 {
     return [[anselServers objectAtIndex: rowIndex] objectForKey: [aTableColumn identifier]];
 }