From 3d1e388877f51be84188ae43f3bea563795f4fc8 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Mon, 21 Nov 2022 15:23:48 +0530 Subject: [PATCH] only use inputFile path if its valid , else fallback to creating a temp copy --- src/api/ffmpeg.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/ffmpeg.ts b/src/api/ffmpeg.ts index 94783fa51..1b0f57068 100644 --- a/src/api/ffmpeg.ts +++ b/src/api/ffmpeg.ts @@ -1,4 +1,5 @@ import { ipcRenderer } from 'electron'; +import { existsSync } from 'fs'; import { logError } from '../services/logging'; import { ElectronFile } from '../types'; @@ -10,7 +11,7 @@ export async function runFFmpegCmd( let inputFilePath = null; let createdTempInputFile = null; try { - if (!inputFile.path) { + if (!existsSync(inputFile.path)) { const inputFileData = new Uint8Array(await inputFile.arrayBuffer()); inputFilePath = await ipcRenderer.invoke( 'write-temp-file',