aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-05-07 16:30:51 +0200
committerMax <post@wickenrode.com>2015-05-07 16:30:51 +0200
commit4d82718f43d92f2ef2193dc603a4486f85fb1582 (patch)
tree3e0e21144d194592bb6444de8a78227ca15690d3 /Source
parent7b579c9ddc7c161cfd4ed99e07bf83ccd72a83ee (diff)
downloadsequelpro-4d82718f43d92f2ef2193dc603a4486f85fb1582.tar.gz
sequelpro-4d82718f43d92f2ef2193dc603a4486f85fb1582.tar.bz2
sequelpro-4d82718f43d92f2ef2193dc603a4486f85fb1582.zip
* Copying text from the query console without having a database selected could cause an exception (fixes #2111)
* Text copied from the query console could have an invalid format in some setups
Diffstat (limited to 'Source')
-rw-r--r--Source/SPQueryController.m17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index 4aba3a14..c57621d8 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -171,20 +171,23 @@ static SPQueryController *sharedQueryController = nil;
if (i < [messagesVisibleSet count]) {
SPConsoleMessage *message = NSArrayObjectAtIndex(messagesVisibleSet, i);
- if (includeTimestamps || includeConnections) [string appendString:@"/* "];
+ if (includeTimestamps || includeConnections || includeDatabases) [string appendString:@"/* "];
- if (includeTimestamps) {
- [string appendString:[dateFormatter stringFromDate:[message messageDate]]];
+ NSDate *date = [message messageDate];
+ if (includeTimestamps && date) {
+ [string appendString:[dateFormatter stringFromDate:date]];
[string appendString:@" "];
}
- if (includeConnections) {
- [string appendString:[message messageConnection]];
+ NSString *connection = [message messageConnection];
+ if (includeConnections && connection) {
+ [string appendString:connection];
[string appendString:@" "];
}
- if (includeDatabases) {
- [string appendString:[message messageDatabase]];
+ NSString *database = [message messageDatabase];
+ if (includeDatabases && database) {
+ [string appendString:database];
[string appendString:@" "];
}