mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
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:
@@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user