From 6a684266a24b3bdee20e5498eb37346263fd62b6 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 16 Feb 2017 21:09:53 -0700 Subject: [PATCH] Fix crash when file does not exist... and 404 page contents don't exist :) --- core/servers/content/web.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/servers/content/web.js b/core/servers/content/web.js index 38e28442..11394659 100644 --- a/core/servers/content/web.js +++ b/core/servers/content/web.js @@ -160,10 +160,11 @@ exports.getModule = class WebServerModule extends ServerModule { routeStaticFile(req, resp) { const fileName = req.url.substr(req.url.indexOf('/', 1)); const filePath = paths.join(Config.contentServers.web.staticRoot, fileName); + const self = this; fs.stat(filePath, (err, stats) => { if(err) { - return this.respondWithError(resp, 404, 'File not found.', 'File Not Found'); + return self.respondWithError(resp, 404, 'File not found.', 'File Not Found'); } const headers = {