diff options
-rw-r--r-- | macosx/HBPresetsViewController.m | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m index fd8bc9677..8933c7e27 100644 --- a/macosx/HBPresetsViewController.m +++ b/macosx/HBPresetsViewController.m @@ -101,7 +101,7 @@ [panel beginWithCompletionHandler:^(NSInteger result) { - if (result == NSOKButton) + if (result == NSFileHandlingPanelOKButton) { NSURL *presetExportDirectory = [panel.URL URLByDeletingLastPathComponent]; [[NSUserDefaults standardUserDefaults] setURL:presetExportDirectory forKey:@"LastPresetExportDirectoryURL"]; @@ -133,19 +133,22 @@ { [[NSUserDefaults standardUserDefaults] setURL:panel.directoryURL forKey:@"LastPresetImportDirectoryURL"]; - for (NSURL *url in panel.URLs) + if (result == NSFileHandlingPanelOKButton) { - NSError *error; - HBPreset *import = [[HBPreset alloc] initWithContentsOfURL:url error:&error]; - - if (import == nil) - { - [self presentError:error]; - } - - for (HBPreset *child in import.children) + for (NSURL *url in panel.URLs) { - [self.presets addPreset:child]; + NSError *error; + HBPreset *import = [[HBPreset alloc] initWithContentsOfURL:url error:&error]; + + if (import == nil) + { + [self presentError:error]; + } + + for (HBPreset *child in import.children) + { + [self.presets addPreset:child]; + } } } }]; |