diff options
author | Max <post@wickenrode.com> | 2015-06-16 21:28:35 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-06-17 11:54:47 +0200 |
commit | 33539b983532720eede12768fc5a32c6dabb3ca8 (patch) | |
tree | f3b275ed5d12e217981d3b8671fb994deab2304f /Source/SPExportFilenameUtilities.m | |
parent | 8febe85e1cb92fa7f4fc073607bd8b08f850b446 (diff) | |
download | sequelpro-33539b983532720eede12768fc5a32c6dabb3ca8.tar.gz sequelpro-33539b983532720eede12768fc5a32c6dabb3ca8.tar.bz2 sequelpro-33539b983532720eede12768fc5a32c6dabb3ca8.zip |
The export code caused an exception when no database was selected but the filename contained the database token (fixes #2145)
Diffstat (limited to 'Source/SPExportFilenameUtilities.m')
-rw-r--r-- | Source/SPExportFilenameUtilities.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m index df9d3a69..a65b8e53 100644 --- a/Source/SPExportFilenameUtilities.m +++ b/Source/SPExportFilenameUtilities.m @@ -346,15 +346,15 @@ NSString *tokenContent = [filenamePart tokenContent]; if ([tokenContent isEqualToString:NSLocalizedString(@"host", @"export filename host token")]) { - [string appendString:[tableDocumentInstance host]]; + [string appendStringOrNil:[tableDocumentInstance host]]; } else if ([tokenContent isEqualToString:NSLocalizedString(@"database", @"export filename database token")]) { - [string appendString:[tableDocumentInstance database]]; + [string appendStringOrNil:[tableDocumentInstance database]]; } else if ([tokenContent isEqualToString:NSLocalizedString(@"table", @"table")]) { - [string appendString:(table) ? table : @""]; + [string appendStringOrNil:table]; } else if ([tokenContent isEqualToString:NSLocalizedString(@"date", @"export filename date token")]) { [dateFormatter setDateStyle:NSDateFormatterShortStyle]; @@ -380,7 +380,7 @@ [string appendString:[dateFormatter stringFromDate:[NSDate date]]]; } else if ([tokenContent isEqualToString:NSLocalizedString(@"favorite", @"export filename favorite name token")]) { - [string appendString:[tableDocumentInstance name]]; + [string appendStringOrNil:[tableDocumentInstance name]]; } } else { |