Added some more checks around the error handling.

This commit is contained in:
Damiano Galassi committed 2014-10-15 09:59:38 +02:00
1 parent 3f9feb7cb6
commit 6993da4002
1 file changed
+11 -6
+11 -6
View File
@@ -214,7 +214,7 @@
// not implemented // not implemented
break; break;
} }
if (_optimize) { if (success && _optimize) {
[saveOperationName setStringValue:@"Optimizing…"]; [saveOperationName setStringValue:@"Optimizing…"];
success = [self.mp4 optimize]; success = [self.mp4 optimize];
_optimize = NO; _optimize = NO;
@@ -242,6 +242,7 @@
IOPMAssertionRelease(assertionID); IOPMAssertionRelease(assertionID);
*outError = [inError autorelease]; *outError = [inError autorelease];
[*outError retain];
[attributes release]; [attributes release];
[self saveDidComplete:outError URL:absoluteURL]; [self saveDidComplete:outError URL:absoluteURL];
@@ -397,18 +398,22 @@
- (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem - (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem
{ {
if (toolbarItem == addTracks) if (toolbarItem == addTracks) {
return YES; return YES;
}
else if (toolbarItem == deleteTrack) if (toolbarItem == deleteTrack) {
if ([fileTracksTable selectedRow] != -1 && [NSApp isActive]) if ([fileTracksTable selectedRow] != -1 && [NSApp isActive])
return YES; return YES;
}
if (toolbarItem == searchMetadata) if (toolbarItem == searchMetadata) {
return YES; return YES;
}
if (toolbarItem == sendToQueue) if (toolbarItem == sendToQueue) {
return YES; return YES;
}
return NO; return NO;
} }