Permalink
Browse files

* Copying text from the query console without having a database selec…

…ted could cause an exception (fixes #2111)

* Text copied from the query console could have an invalid format in some setups
  • Loading branch information...
dmoagx committed May 7, 2015
1 parent 7b579c9 commit 4d82718f43d92f2ef2193dc603a4486f85fb1582
Showing with 10 additions and 7 deletions.
  1. +10 −7 Source/SPQueryController.m
@@ -171,20 +171,23 @@ - (void)copy:(id)sender
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:@" "];
}

0 comments on commit 4d82718

Please sign in to comment.