1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-26 01:23:24 +00:00

Fix apply window styles crashing the app

This commit is contained in:
Bernd Schoolmann
2025-11-19 06:09:43 +01:00
parent 3b97093338
commit f606055436

View File

@@ -43,13 +43,16 @@ export function applyMainWindowStyles(window: BrowserWindow, existingWindowState
window.setMinimumSize(680, 500);
// need to guard against null/undefined values
try {
if (existingWindowState?.width && existingWindowState?.height) {
window.setSize(existingWindowState.width, existingWindowState.height);
}
if (existingWindowState?.width && existingWindowState?.height) {
window.setSize(existingWindowState.width, existingWindowState.height);
}
if (existingWindowState?.x && existingWindowState?.y) {
window.setPosition(existingWindowState.x, existingWindowState.y);
if (existingWindowState?.x && existingWindowState?.y) {
window.setPosition(existingWindowState.x, existingWindowState.y);
}
} catch (e) {
this.logService.error("Error applying main window styles:", e);
}
window.setWindowButtonVisibility?.(true);