Skip to content

Commit e145641

Browse files
fujunweirogerwang
authored andcommitted
fix the crash of opening new window without menu nwjs#5737
1 parent fdde6db commit e145641

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/api/nw_window_api.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,10 @@ bool NwCurrentWindowInternalClearMenuFunction::RunAsync() {
354354
browser_view_layout->set_menu_bar(NULL);
355355
native_app_window_views->layout_();
356356
native_app_window_views->SchedulePaint();
357-
window->menu_->RemoveKeys();
358-
window->menu_ = NULL;
357+
if (window->menu_) {
358+
window->menu_->RemoveKeys();
359+
window->menu_ = NULL;
360+
}
359361
#endif
360362
return true;
361363
}

0 commit comments

Comments
 (0)