Skip to content

Commit 8798576

Browse files
committed
Fix crash in nw.Window.Close()
part of nwjs#7059
1 parent 586ed92 commit 8798576

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/nw_window_api.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ static HWND getHWND(AppWindow* window) {
192192
#endif
193193

194194
void NwCurrentWindowInternalCloseFunction::DoClose(AppWindow* window) {
195-
window->GetBaseWindow()->ForceClose();
195+
if (window && window->GetBaseWindow())
196+
window->GetBaseWindow()->ForceClose();
196197
}
197198

198199
void NwCurrentWindowInternalCloseFunction::DoCloseBrowser(Browser* browser) {

0 commit comments

Comments
 (0)