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

This commit is contained in:
AmitwalaH
2026-04-14 12:45:02 +05:30
parent a6ae0e6d98
commit 6441e96035
+3 -1
View File
@@ -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,
};
}
});