diff options
-rw-r--r-- | Source/SPExportController.m | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 97840171..b249505a 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -417,8 +417,14 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; [panel setDirectoryURL:[NSURL URLWithString:[exportPathField stringValue]]]; [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) { if (returnCode == NSOKButton) { - [exportPathField setStringValue:[[panel directoryURL] path]]; - [prefs setObject:[[panel directoryURL] path] forKey:SPExportLastDirectory]; + NSString *path = [[panel directoryURL] path]; + if(!path) { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"File panel ended with OK, but returned nil for path!? directoryURL=%@,isFileURL=%d",[panel directoryURL],[[panel directoryURL] isFileURL]] + userInfo:nil]; + } + [exportPathField setStringValue:path]; + [prefs setObject:path forKey:SPExportLastDirectory]; } }]; } |