Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
with
10 additions
and
7 deletions.
-
+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:@" "]; |
|
|
} |
|
|
|
|
|