aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2017-03-22 01:50:56 +0000
committerStuart Connolly <stuart02@gmail.com>2017-03-22 01:50:56 +0000
commitbab93f8ce74a6644c9a3d8a50fa26230f127c550 (patch)
tree9ae36608f1eed1dc0eae82cf559eac3c025fa2fc /Source
parentbde46d2295457eeb678f7791c59e79913f7c449c (diff)
downloadsequelpro-bab93f8ce74a6644c9a3d8a50fa26230f127c550.tar.gz
sequelpro-bab93f8ce74a6644c9a3d8a50fa26230f127c550.tar.bz2
sequelpro-bab93f8ce74a6644c9a3d8a50fa26230f127c550.zip
Fix warnings.
Diffstat (limited to 'Source')
-rw-r--r--Source/SPBundleCommandRunner.m24
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/SPBundleCommandRunner.m b/Source/SPBundleCommandRunner.m
index 08fad6f1..e884e21d 100644
--- a/Source/SPBundleCommandRunner.m
+++ b/Source/SPBundleCommandRunner.m
@@ -164,21 +164,29 @@
if([doc getConnection] == nil)
doc = nil;
else {
- for (NSWindow *aWindow in [NSApp orderedWindows]) {
- if([[[[aWindow windowController] class] description] isEqualToString:@"SPWindowController"]) {
- if([[[aWindow windowController] documents] count] && [[[[[[aWindow windowController] documents] objectAtIndex:0] class] description] isEqualToString:@"SPDatabaseDocument"]) {
+ for (NSWindow *aWindow in [NSApp orderedWindows])
+ {
+ if ([[[[aWindow windowController] class] description] isEqualToString:@"SPWindowController"]) {
+
+ SPWindowController *windowController = (SPWindowController *)[aWindow windowController];
+ NSArray *documents = [windowController documents];
+
+ if ([documents count] && [[[[documents objectAtIndex:0] class] description] isEqualToString:@"SPDatabaseDocument"]) {
// Check if connected
- if([[[[aWindow windowController] documents] objectAtIndex:0] getConnection])
- doc = [[[aWindow windowController] documents] objectAtIndex:0];
- else
+ if ([[documents objectAtIndex:0] getConnection]) {
+ doc = [documents objectAtIndex:0];
+ }
+ else {
doc = nil;
+ }
}
}
- if(doc) break;
+
+ if (doc) break;
}
}
- if(doc != nil) {
+ if (doc != nil) {
[doc setProcessID:uuid];