This commit is contained in:
ZacharyZhang-NY committed 2026-04-05 20:14:48 -04:00
1 parent 09971cabc2
commit 9145572422
163 files changed
+3348 -2874

No files matched your search

+3 -3
View File
@@ -20,13 +20,13 @@ function safeParseState(filePath: string): StoredWindowState | null {
const parsed = JSON.parse(raw) as Partial<StoredWindowState>;
if (!parsed.bounds || typeof parsed.bounds !== "object") return null;
const { width, height, x, y } = parsed.bounds as Partial<Rectangle>;
if (![width, height].every((value) => typeof value === "number" && Number.isFinite(value))) {
if (typeof width !== "number" || !Number.isFinite(width) || typeof height !== "number" || !Number.isFinite(height)) {
return null;
}
return {
bounds: {
width: width!,
height: height!,
width,
height,
x: typeof x === "number" && Number.isFinite(x) ? x : DEFAULT_BOUNDS.x,
y: typeof y === "number" && Number.isFinite(y) ? y : DEFAULT_BOUNDS.y,
},