From 039dd4f2645ba84d4615fea7aa6f52eb96f42cf5 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 22 Oct 2014 13:52:37 -0700 Subject: [PATCH] Fixed issue with HeroVictoryModal assuming achievements all have rewards. --- app/views/play/level/modal/HeroVictoryModal.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index ab92b7db1..0c5a52cf0 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -37,7 +37,7 @@ module.exports = class HeroVictoryModal extends ModalView thangTypeOriginals = [] achievementIDs = [] for achievement in @achievements.models - rewards = achievement.get('rewards') + rewards = achievement.get('rewards') or {} thangTypeOriginals.push rewards.heroes or [] thangTypeOriginals.push rewards.items or [] achievement.completed = LocalMongo.matchesQuery(@session.attributes, achievement.get('query')) @@ -95,7 +95,7 @@ module.exports = class HeroVictoryModal extends ModalView # achievement.completed = true # achievement.completedAWhileAgo = false # achievement.attributes.worth = (index + 1) * achievement.get('worth', true) - # rewards = achievement.get('rewards') + # rewards = achievement.get('rewards') or {} # rewards.gems *= (index + 1) c.thangTypes = @thangTypes