From fab7d53150e7035db7fbef467d583339cf5e19b6 Mon Sep 17 00:00:00 2001 From: CakeLancelot Date: Tue, 22 Dec 2020 12:00:44 -0600 Subject: [PATCH] Check before deleting rankurl.txt --- resources/app/files/assets/js/serverselector.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/app/files/assets/js/serverselector.js b/resources/app/files/assets/js/serverselector.js index 16be006..0bc1b16 100644 --- a/resources/app/files/assets/js/serverselector.js +++ b/resources/app/files/assets/js/serverselector.js @@ -75,8 +75,10 @@ function setGameInfo(serverUUID) { console.log("Using rank endpoint " + rankurl) remotefs.writeFileSync(__dirname+"\\rankurl.txt", rankurl); } else { - // delete the file, this server won't be using it - remotefs.unlinkSync(__dirname+"\\rankurl.txt") + if (remotefs.existsSync(__dirname+"\\rankurl.txt")) { + // delete the file, this server won't be using it + remotefs.unlinkSync(__dirname+"\\rankurl.txt"); + } } }