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);