diff --git a/modules/stuff.js b/modules/stuff.js index 8b95381..4b3527e 100644 --- a/modules/stuff.js +++ b/modules/stuff.js @@ -60,6 +60,13 @@ function appGetFileType (app, wildcard, contentType, pageToRender) { fp = fp.join('/') } const fpath = './public/files' + fp + if (!fs.existsSync(fpath)) { + res.render('stuff/nofile', { + missingFile: fpath, + url + }) + return + } if (req.query.stream || !pageToRender) { const stat = fs.statSync(fpath) const fileSize = stat.size