Skip to content

Commit 6441e96

Browse files
committed
fix: prevent crash in read-binary-file handler and improve error debugging
1 parent a6ae0e6 commit 6441e96

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

electron/ipc/handlers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,9 @@ export function registerIpcHandlers(
501501
});
502502

503503
ipcMain.handle("read-binary-file", async (_, inputPath: string) => {
504+
let normalizedPath: string | null = null;
504505
try {
505-
const normalizedPath = normalizeVideoSourcePath(inputPath);
506+
normalizedPath = normalizeVideoSourcePath(inputPath);
506507
if (!normalizedPath) {
507508
return { success: false, message: "Invalid file path" };
508509
}
@@ -527,6 +528,7 @@ export function registerIpcHandlers(
527528
success: false,
528529
message: "Failed to read binary file",
529530
error: String(error),
531+
path: normalizedPath,
530532
};
531533
}
532534
});

0 commit comments

Comments
 (0)