From: Michael J. Rubinsky Date: Fri, 25 Sep 2009 20:58:23 +0000 (-0400) Subject: If iPhoto cannot locate the original image file, we won't have a valid X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fd1e57a2f4e552eba87b3e8070add4f8e629ac5d;p=horde.git If iPhoto cannot locate the original image file, we won't have a valid NSData object for the image data. Also, silence the last compiler warning. --- diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index 74a70be07..90d4c1f13 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -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]]; }