Skip to content

Commit 443a4b8

Browse files
committed
mac: Use AsNSImage instead of ToNSImage
It can get rid of the empty check.
1 parent 509ce0d commit 443a4b8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

atom/browser/ui/tray_icon_cocoa.mm

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,11 @@ - (void)handleDoubleClick:(id)sender {
5454
}
5555

5656
void TrayIconCocoa::SetImage(const gfx::Image& image) {
57-
if (!image.IsEmpty())
58-
[item_ setImage:image.ToNSImage()];
57+
[item_ setImage:image.AsNSImage()];
5958
}
6059

6160
void TrayIconCocoa::SetPressedImage(const gfx::Image& image) {
62-
if (!image.IsEmpty())
63-
[item_ setAlternateImage:image.ToNSImage()];
61+
[item_ setAlternateImage:image.AsNSImage()];
6462
}
6563

6664
void TrayIconCocoa::SetToolTip(const std::string& tool_tip) {

0 commit comments

Comments
 (0)