提交 cd1b7130 编写于 作者: M Matt Bierner

Remove call to withNullAsUndefined

上级 d0f109bc
......@@ -25,7 +25,6 @@ import * as perf from 'vs/base/common/performance';
import { resolveMarketplaceHeaders } from 'vs/platform/extensionManagement/node/extensionGalleryService';
import { getBackgroundColor } from 'vs/code/electron-main/theme';
import { RunOnceScheduler } from 'vs/base/common/async';
import { withNullAsUndefined } from 'vs/base/common/types';
import { endsWith } from 'vs/base/common/strings';
export interface IWindowCreationOptions {
......@@ -690,7 +689,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
private restoreWindowState(state?: IWindowState): IWindowState {
if (state) {
try {
state = withNullAsUndefined(this.validateWindowState(state));
state = this.validateWindowState(state);
} catch (err) {
this.logService.warn(`Unexpected error validating window state: ${err}\n${err.stack}`); // somehow display API can be picky about the state to validate
}
......@@ -703,9 +702,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return state;
}
private validateWindowState(state: IWindowState): IWindowState | null {
private validateWindowState(state: IWindowState): IWindowState | undefined {
if (!state) {
return null;
return undefined;
}
if (typeof state.x !== 'number'
......@@ -713,11 +712,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|| typeof state.width !== 'number'
|| typeof state.height !== 'number'
) {
return null;
return undefined;
}
if (state.width <= 0 || state.height <= 0) {
return null;
return undefined;
}
const displays = screen.getAllDisplays();
......@@ -793,7 +792,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return state;
}
return null;
return undefined;
}
private getWorkingArea(display: Display): Rectangle | undefined {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册