From dd6f22546108ecdcb92a0ffcbf262d1f3b0dcada Mon Sep 17 00:00:00 2001 From: Bobby Date: Fri, 15 Apr 2022 20:31:12 +0700 Subject: [PATCH] fix: missing default vars in multerStorage --- controllers/utils/multerStorage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/utils/multerStorage.js b/controllers/utils/multerStorage.js index 12f3452..ff220cc 100644 --- a/controllers/utils/multerStorage.js +++ b/controllers/utils/multerStorage.js @@ -26,7 +26,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) { let tempError = null let tempObject = {} let tempWeight = 0 - const _cb = (err, result, weight = 1) => { + const _cb = (err = null, result = {}, weight = 1) => { tempError = err tempWeight += weight tempObject = Object.assign(result, tempObject)