From 41726949e8f3e27b5c5251bd41d4099ab87df679 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 12 Apr 2020 20:43:38 +0200 Subject: [PATCH] not specified errors should be undefined and not null in UploadProvider Signed-off-by: Philip Molares Signed-off-by: David Mehren --- lib/web/imageRouter/filesystem.ts | 2 +- lib/web/imageRouter/imgur.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/imageRouter/filesystem.ts b/lib/web/imageRouter/filesystem.ts index 79aefa0db..a1b6b3fc8 100644 --- a/lib/web/imageRouter/filesystem.ts +++ b/lib/web/imageRouter/filesystem.ts @@ -17,7 +17,7 @@ const FilesystemUploadProvider: UploadProvider = { return } - callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href) + callback(undefined, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href) } } diff --git a/lib/web/imageRouter/imgur.ts b/lib/web/imageRouter/imgur.ts index b3ae606b1..487c1599a 100644 --- a/lib/web/imageRouter/imgur.ts +++ b/lib/web/imageRouter/imgur.ts @@ -20,7 +20,7 @@ const ImgurUploadProvider: UploadProvider = { imgur.uploadFile(imagePath) .then(function (json) { logger.debug(`SERVER uploadimage success: ${JSON.stringify(json)}`) - callback(null, json.data.link.replace(/^http:\/\//i, 'https://')) + callback(undefined, json.data.link.replace(/^http:\/\//i, 'https://')) }).catch(function (err) { callback(new Error(err), undefined) })