From b4ff7d4be4cfdb39afc7e9786989049b1a6039f1 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 29 Dec 2013 00:33:58 -0700 Subject: [PATCH] #1499 check that task[0] exists first --- public/js/filters/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/filters/filters.js b/public/js/filters/filters.js index 222a8bb30a..e20db4aadf 100644 --- a/public/js/filters/filters.js +++ b/public/js/filters/filters.js @@ -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}); } }) \ No newline at end of file