diff --git a/src/apps.js b/src/apps.js index a71a0f24a..139901e29 100644 --- a/src/apps.js +++ b/src/apps.js @@ -84,7 +84,7 @@ function AppsError(reason, errorOrMessage) { this.name = this.constructor.name; this.reason = reason; - if (typeof errorOrMessage === 'undefined' || errorOrMessage === null) { + if (typeof errorOrMessage === 'undefined') { this.message = reason; } else if (typeof errorOrMessage === 'string') { this.message = errorOrMessage; diff --git a/src/databaseerror.js b/src/databaseerror.js index f436cb592..a63b5db3a 100644 --- a/src/databaseerror.js +++ b/src/databaseerror.js @@ -16,7 +16,7 @@ function DatabaseError(reason, errorOrMessage) { this.name = this.constructor.name; this.reason = reason; - if (typeof errorOrMessage === 'undefined' || errorOrMessage === null) { + if (typeof errorOrMessage === 'undefined') { this.message = reason; } else if (typeof errorOrMessage === 'string') { this.message = errorOrMessage; diff --git a/src/userdb.js b/src/userdb.js index a8488c474..075bf843a 100644 --- a/src/userdb.js +++ b/src/userdb.js @@ -171,7 +171,7 @@ function del(userId, callback) { database.transaction(queries, function (error, result) { if (error && error.code === 'ER_NO_REFERENCED_ROW_2') return callback(new DatabaseError(DatabaseError.NOT_FOUND, error)); if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error)); - if (result[1].affectedRows !== 1) return callback(new DatabaseError(DatabaseError.NOT_FOUND, error)); + if (result[1].affectedRows !== 1) return callback(new DatabaseError(DatabaseError.NOT_FOUND)); callback(error); });