fix: correct sort task when task is at the top

closes #7457

!0 === true, so we need to check for == null which matches undefined and
null
This commit is contained in:
Blade Barringer
2016-05-23 22:33:18 -05:00
parent 810355d2a5
commit 8faf73084a

View File

@@ -21,7 +21,7 @@ module.exports = function sortTask (user, req = {}) {
if (index === -1) { if (index === -1) {
throw new NotFound(i18n.t('messageTaskNotFound', req.language)); throw new NotFound(i18n.t('messageTaskNotFound', req.language));
} }
if (!to && !fromParam) { if (to == null && fromParam == null) {
throw new BadRequest('?to=__&from=__ are required'); throw new BadRequest('?to=__&from=__ are required');
} }