diff options
author | Max <post@wickenrode.com> | 2015-06-16 21:28:35 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-06-16 21:28:35 +0200 |
commit | f37ff9634d285d8d8f197d80ed29171dc9258270 (patch) | |
tree | 120229228ed8ed08cc05873b5411d4dad75ede63 /Source/SPExportFilenameUtilities.m | |
parent | b7b9b155a9938e3b8f570144e9cb35ce4ed7df57 (diff) | |
download | sequelpro-f37ff9634d285d8d8f197d80ed29171dc9258270.tar.gz sequelpro-f37ff9634d285d8d8f197d80ed29171dc9258270.tar.bz2 sequelpro-f37ff9634d285d8d8f197d80ed29171dc9258270.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 { |