Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix: prevent crash in read-binary-file handler and improve error debugging

AmitwalaH6441e96035cd
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 4cb487567..d0b42a3cc 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -501,8 +501,9 @@ export function registerIpcHandlers(
});
ipcMain.handle("read-binary-file", async (_, inputPath: string) => {
+ let normalizedPath: string | null = null;
try {
- const normalizedPath = normalizeVideoSourcePath(inputPath);
+ normalizedPath = normalizeVideoSourcePath(inputPath);
if (!normalizedPath) {
return { success: false, message: "Invalid file path" };
}
@@ -527,6 +528,7 @@ export function registerIpcHandlers(
success: false,
message: "Failed to read binary file",
error: String(error),
+ path: normalizedPath,
};
}
});