Fix callback validation
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
This commit is contained in:
@@ -4,6 +4,7 @@ const path = require('path')
|
||||
|
||||
const config = require('../../config')
|
||||
const {getImageMimeType} = require('../../utils')
|
||||
const logger = require('../../logger')
|
||||
|
||||
const Minio = require('minio')
|
||||
const minioClient = new Minio.Client({
|
||||
@@ -21,7 +22,7 @@ exports.uploadImage = function (imagePath, callback) {
|
||||
}
|
||||
|
||||
if (!callback || typeof callback !== 'function') {
|
||||
callback(new Error('Callback has to be a function'), null)
|
||||
logger.error('Callback has to be a function')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user