From 2230b67857e19be3e1529a1b025986fbbfdb1ed3 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 9 Sep 2013 09:12:00 -0400 Subject: [PATCH] tmp hotfix, people still have null tasks? `Cannot read property 'tags' of undefined` --- src/models/user.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/user.js b/src/models/user.js index 8b1de78cb4..76b9fb7403 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -218,6 +218,7 @@ function transformTaskLists(doc) { _.each(['habit', 'daily', 'todo', 'reward'], function(type) { // we use _.transform instead of a simple _.where in order to maintain sort-order doc[type + "s"] = _.reduce(doc[type + "Ids"], function(m, tid) { + if (!doc.tasks[tid]) return m; // FIXME tmp hotfix, people still have null tasks? if (!doc.tasks[tid].tags) doc.tasks[tid].tags = {}; // FIXME remove this when we switch tasks to subdocs and can define tags default in schema m.push(doc.tasks[tid]); return m;