mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
Fix callback validation
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
This commit is contained in:
parent
65544f9a18
commit
b5574466cd
4 changed files with 7 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
const url = require('url')
|
||||
|
||||
const config = require('../../config')
|
||||
const logger = require('../../logger')
|
||||
|
||||
exports.uploadImage = function (imagePath, callback) {
|
||||
if (!imagePath || typeof imagePath !== 'string') {
|
||||
|
@ -10,7 +11,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue