Skip to content

Commit df49763

Browse files
committed
maybe fix a crash in ShowAutoUpdateDialog
1 parent 3f9f561 commit df49763

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/UpdateCheck.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ static DWORD ShowAutoUpdateDialog(HWND hwndParent, HttpRsp* rsp, UpdateCheck upd
340340
// shouldn't happen but it's fine, we just tell the user
341341
logf("ShowAutoUpdateDialog: didn't find download url. Auto update data:\n%s\n", data->Get());
342342
auto win = FindWindowInfoByHwnd(hwndParent);
343+
// window could be destroyed since we issued update check
344+
if (!win) {
345+
return 0;
346+
}
343347
win->notifications->RemoveForGroup(kindNotifUpdateCheckInProgress);
344348
NotifyUserOfUpdate(updateInfo);
345349
return 0;

0 commit comments

Comments
 (0)