File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -73,16 +73,20 @@ - (void)loadImageForParams:(NSDictionary *)params completionHandler:(void (^)(NS
73
73
[NSURLConnection sendAsynchronousRequest: [NSURLRequest requestWithURL: url]
74
74
queue: [NSOperationQueue mainQueue ]
75
75
completionHandler: ^(NSURLResponse *response, NSData *data, NSError *error) {
76
+ NSImage *image = nil ;
77
+
76
78
if (data) {
77
- NSImage * image = [[NSImage alloc ] initWithData: data];
79
+ image = [[NSImage alloc ] initWithData: data];
78
80
79
81
if (params[@" templateImage" ]) {
80
82
image.template = YES ;
81
83
}
82
-
83
- handler (image);
84
84
}
85
+
86
+ handler (image);
85
87
}];
88
+ } else {
89
+ handler (nil );
86
90
}
87
91
}
88
92
}
@@ -470,7 +474,6 @@ - (void) cycleLines {
470
474
}
471
475
472
476
// Add image if present
473
- self.statusItem .image = nil ;
474
477
[self loadImageForParams: params completionHandler: ^(NSImage *image) {
475
478
_statusItem.image = image;
476
479
}];
You can’t perform that action at this time.
0 commit comments