fixed crash when no window position is saved (fixes #1175)

This commit is contained in:
Eugene Pankov
2019-07-04 12:04:24 +02:00
parent d8f4c29073
commit 7b249a82d7

View File

@@ -51,8 +51,9 @@ export class Window {
show: false,
backgroundColor: '#00000000'
}
Object.assign(bwOptions, this.windowBounds)
if (this.windowBounds) {
Object.assign(bwOptions, this.windowBounds)
const closestDisplay = screen.getDisplayNearestPoint( {x: this.windowBounds.x, y: this.windowBounds.y} )
const [left1, top1, right1, bottom1] = [this.windowBounds.x, this.windowBounds.y, this.windowBounds.x + this.windowBounds.width, this.windowBounds.y + this.windowBounds.height];
@@ -62,6 +63,7 @@ export class Window {
bwOptions.x = closestDisplay.bounds.width / 2 - bwOptions.width / 2;
bwOptions.y = closestDisplay.bounds.height / 2 - bwOptions.height / 2;
}
}
if ((configData.appearance || {}).frame === 'native') {
bwOptions.frame = true