Skip to content

Commit 58cfc84

Browse files
committed
fixes #362
1 parent 2e6bad8 commit 58cfc84

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

App/BitBar/Plugin.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ - (void)loadImageForParams:(NSDictionary *)params completionHandler:(void (^)(NS
7373
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url]
7474
queue:[NSOperationQueue mainQueue]
7575
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
76+
NSImage *image = nil;
77+
7678
if (data) {
77-
NSImage *image = [[NSImage alloc] initWithData:data];
79+
image = [[NSImage alloc] initWithData:data];
7880

7981
if (params[@"templateImage"]) {
8082
image.template = YES;
8183
}
82-
83-
handler(image);
8484
}
85+
86+
handler(image);
8587
}];
88+
} else {
89+
handler(nil);
8690
}
8791
}
8892
}
@@ -470,7 +474,6 @@ - (void) cycleLines {
470474
}
471475

472476
// Add image if present
473-
self.statusItem.image = nil;
474477
[self loadImageForParams:params completionHandler:^(NSImage *image) {
475478
_statusItem.image = image;
476479
}];

0 commit comments

Comments
 (0)