Skip to content

Commit

Permalink
Cannot read property 'loadURL' of null (fixes #26588)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed May 15, 2017
1 parent 4529dd4 commit 72c32b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/vs/code/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,6 @@ export class VSCodeWindow {
}

public serializeWindowState(): IWindowState {
if (!this._win) {
return null; // avoid NPE when calling this method after the window has been disposed
}

// fullscreen gets special treatment
if (this._win.isFullScreen()) {
Expand Down
8 changes: 8 additions & 0 deletions src/vs/code/electron-main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,10 @@ export class WindowsManager implements IWindowsMainService {
detail: nls.localize('appStalledDetail', "You can reopen or close the window or keep waiting."),
noLink: true
}, result => {
if (!vscodeWindow.win) {
return; // Return early if the window has been going down already
}

if (result === 0) {
vscodeWindow.reload();
} else if (result === 2) {
Expand All @@ -1223,6 +1227,10 @@ export class WindowsManager implements IWindowsMainService {
detail: nls.localize('appCrashedDetail', "We are sorry for the inconvenience! You can reopen the window to continue where you left off."),
noLink: true
}, result => {
if (!vscodeWindow.win) {
return; // Return early if the window has been going down already
}

if (result === 0) {
vscodeWindow.reload();
} else if (result === 1) {
Expand Down

0 comments on commit 72c32b2

Please sign in to comment.