From a5ebe4f452578246d68d0145fa2e70cb0677615c Mon Sep 17 00:00:00 2001 From: Thaum Date: Fri, 17 Apr 2015 10:41:13 +0000 Subject: [PATCH] Fixed error setting character name as title on hot code push --- rpg-docs/Routes/Routes.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpg-docs/Routes/Routes.js b/rpg-docs/Routes/Routes.js index cf1b446a..8d1ea87a 100644 --- a/rpg-docs/Routes/Routes.js +++ b/rpg-docs/Routes/Routes.js @@ -44,12 +44,10 @@ Router.map( function () { return data; }, onAfterAction: function() { - var char = Characters.findOne({_id: this.params._id}, {fields: {_id: 1, name: 1, color: 1}}); - var name = char.name; + var char = Characters.findOne({_id: this.params._id}, {fields: {name: 1}}); + var name = char && char.name; if(name){ document.title = name; - } else { - document.title = appName + "Character"; } } });