From d4664bad453f187f42346b1505cecdea91482024 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Tue, 24 Mar 2020 19:36:45 -0400 Subject: [PATCH] Additional fix for bug that caused server to crash when failing to update youtube-dl --- backend/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/app.js b/backend/app.js index fb24c66..8080082 100644 --- a/backend/app.js +++ b/backend/app.js @@ -655,6 +655,11 @@ async function autoUpdateYoutubeDL() { let current_app_details = JSON.parse(fs.readFileSync(current_app_details_path)); let current_version = current_app_details['version']; let stored_binary_path = current_app_details['path']; + if (!stored_binary_path || typeof stored_binary_path !== 'string') { + console.log(`Failed to get youtube-dl binary path at location: ${current_app_details_path}. Cancelling update check.`); + resolve(false); + return; + } // got version, now let's check the latest version from the youtube-dl API let youtubedl_api_path = 'https://api.github.com/repos/ytdl-org/youtube-dl/tags';