#1499 check that task[0] exists first

This commit is contained in:
Tyler Renelle 2013-12-29 00:33:58 -07:00
parent d966833782
commit b4ff7d4be4

View file

@ -11,7 +11,7 @@ angular.module('habitrpg')
})
.filter('completedFilter', function(){
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});
}
})