From 661cb2505e8c6d276df57d1bc5df7f3b73bc9659 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 21 Jun 2020 14:31:00 -0700 Subject: [PATCH] Server fix. --- webserver.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webserver.js b/webserver.js index 946a3d59..fe19870e 100644 --- a/webserver.js +++ b/webserver.js @@ -2975,7 +2975,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if ((user == null) || (user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { /*console.log('UploadFile, Invalid Fields:', fields, files);*/ console.log('err4'); res.sendStatus(404); return; } - var xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0])); + var xfile = null; + try { xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0])); } catch (ex) { } if (xfile == null) { res.sendStatus(404); return; } // Get total bytes in the path var totalsize = readTotalFileSize(xfile.fullpath);