Skip to content

The swiss army knife of lossless video/audio editing

fix regression

Mikael Finstad1a20acde36c4
diff --git a/public/electron.js b/public/electron.js
index 8c4e9b1f..3f5d8967 100644
--- a/public/electron.js
+++ b/public/electron.js
@@ -114,7 +114,8 @@ let openFileInitial;
electron.ipcMain.on('renderer-ready', () => {
rendererReady = true;
if (!isDev) {
- const fileToOpen = process.argv[process.argv.length - 1];
+ // Take the last argument, but ONLY if there is more than one argv (first one is the LosslessCut executable)
+ const fileToOpen = process.argv.length > 1 && process.argv[process.argv.length - 1];
// https://github.com/electron/electron/issues/3657
// https://github.com/mifi/lossless-cut/issues/357
if (fileToOpen && !fileToOpen.startsWith('-')) openFile(fileToOpen);