diff --git a/lib/web/imageRouter/filesystem.js b/lib/web/imageRouter/filesystem.js index 7c876d66..a43a2782 100644 --- a/lib/web/imageRouter/filesystem.js +++ b/lib/web/imageRouter/filesystem.js @@ -16,5 +16,12 @@ exports.uploadImage = function (imagePath, callback) { return } - callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href) + let url + try { + url = (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href + } catch (e) { + url = config.serverURL + '/uploads/' + path.basename(imagePath) + } + + callback(null, url) }