#1499 check that task[0] exists first
This commit is contained in:
@@ -11,7 +11,7 @@ angular.module('habitrpg')
|
|||||||
})
|
})
|
||||||
.filter('completedFilter', function(){
|
.filter('completedFilter', function(){
|
||||||
return function(tasks,_showCompleted) {
|
return function(tasks,_showCompleted) {
|
||||||
if (tasks[0].type != 'todo') return tasks;
|
if (!tasks[0] || tasks[0].type != 'todo') return tasks;
|
||||||
return _.where(tasks, {completed:!!_showCompleted});
|
return _.where(tasks, {completed:!!_showCompleted});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user