Skip to content

Commit 70e7ae8

Browse files
committed
Fix nwjs#6143: Crash when called window nw.Window.get().setProgessBar()
1 parent 74b7243 commit 70e7ae8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/nw_window_api_mac.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ - (void)drawRect:(NSRect)dirtyRect {
7878
EXTENSION_FUNCTION_VALIDATE(args_->GetDouble(0, &progress));
7979
NSDockTile *dockTile = [NSApp dockTile];
8080
NWProgressBar *progressIndicator = NULL;
81-
82-
if (dockTile.contentView == NULL && progress >= 0) {
81+
82+
if ((dockTile.contentView == NULL || [dockTile.contentView.subviews count] == 0 )&& progress >= 0) {
8383

8484
// create image view to draw application icon
8585
NSImageView *iv = [[NSImageView alloc] init];
@@ -125,6 +125,7 @@ - (void)drawRect:(NSRect)dirtyRect {
125125
}
126126

127127
[dockTile display];
128+
SendResponse(true);
128129
return true;
129130
}
130131

0 commit comments

Comments
 (0)