Skip to content

Commit bab93f8

Browse files
committed
Fix warnings.
1 parent bde46d2 commit bab93f8

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

Source/SPBundleCommandRunner.m

+16-8
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,29 @@ + (NSString *)runBashCommand:(NSString *)command withEnvironment:(NSDictionary*)
164164
if([doc getConnection] == nil)
165165
doc = nil;
166166
else {
167-
for (NSWindow *aWindow in [NSApp orderedWindows]) {
168-
if([[[[aWindow windowController] class] description] isEqualToString:@"SPWindowController"]) {
169-
if([[[aWindow windowController] documents] count] && [[[[[[aWindow windowController] documents] objectAtIndex:0] class] description] isEqualToString:@"SPDatabaseDocument"]) {
167+
for (NSWindow *aWindow in [NSApp orderedWindows])
168+
{
169+
if ([[[[aWindow windowController] class] description] isEqualToString:@"SPWindowController"]) {
170+
171+
SPWindowController *windowController = (SPWindowController *)[aWindow windowController];
172+
NSArray *documents = [windowController documents];
173+
174+
if ([documents count] && [[[[documents objectAtIndex:0] class] description] isEqualToString:@"SPDatabaseDocument"]) {
170175
// Check if connected
171-
if([[[[aWindow windowController] documents] objectAtIndex:0] getConnection])
172-
doc = [[[aWindow windowController] documents] objectAtIndex:0];
173-
else
176+
if ([[documents objectAtIndex:0] getConnection]) {
177+
doc = [documents objectAtIndex:0];
178+
}
179+
else {
174180
doc = nil;
181+
}
175182
}
176183
}
177-
if(doc) break;
184+
185+
if (doc) break;
178186
}
179187
}
180188

181-
if(doc != nil) {
189+
if (doc != nil) {
182190

183191
[doc setProcessID:uuid];
184192

0 commit comments

Comments
 (0)