From f88d5426c99046329931974a4477bdfe518a1810 Mon Sep 17 00:00:00 2001 From: Hinara Date: Sat, 25 Jul 2020 02:39:09 +0200 Subject: [PATCH 1/2] Fix #1807 https://github.com/webtorrent/webtorrent-desktop/blob/eb5a291c8b9cbfae96f306e153387e720a7baa72/src/renderer/lib/migrations.js#L219 cause external player to be a empty string instead of a null one --- src/main/external-player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/external-player.js b/src/main/external-player.js index 3a183102..b9309dcc 100644 --- a/src/main/external-player.js +++ b/src/main/external-player.js @@ -17,12 +17,12 @@ let proc = null function checkInstall (playerPath, cb) { // check for VLC if external player has not been specified by the user // otherwise assume the player is installed - if (playerPath == null) return vlcCommand(cb) + if (playerPath.length === 0) return vlcCommand(cb) process.nextTick(() => cb(null)) } function spawn (playerPath, url, title) { - if (playerPath != null) return spawnExternal(playerPath, [url]) + if (playerPath.length !== 0) return spawnExternal(playerPath, [url]) // Try to find and use VLC if external player is not specified vlcCommand((err, vlcPath) => { From 0edeaa4d58de837b5f8af1cff136a6e85503f571 Mon Sep 17 00:00:00 2001 From: Hinara Date: Thu, 30 Jul 2020 15:06:26 +0200 Subject: [PATCH 2/2] Accept null value as playerPath --- src/main/external-player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/external-player.js b/src/main/external-player.js index b9309dcc..77ef44ac 100644 --- a/src/main/external-player.js +++ b/src/main/external-player.js @@ -17,12 +17,12 @@ let proc = null function checkInstall (playerPath, cb) { // check for VLC if external player has not been specified by the user // otherwise assume the player is installed - if (playerPath.length === 0) return vlcCommand(cb) + if (!playerPath) return vlcCommand(cb) process.nextTick(() => cb(null)) } function spawn (playerPath, url, title) { - if (playerPath.length !== 0) return spawnExternal(playerPath, [url]) + if (playerPath) return spawnExternal(playerPath, [url]) // Try to find and use VLC if external player is not specified vlcCommand((err, vlcPath) => {