Fixed bug with incompletely added levels jamming the campaign editor.

This commit is contained in:
Nick Winter 2015-02-09 08:19:59 -08:00
parent 38c6d6f531
commit 22c2c7df63

View file

@ -280,7 +280,7 @@ module.exports = class CampaignView extends RootView
determineNextLevel: (levels) ->
foundNext = false
for level in levels
level.nextLevels = (reward.level for reward in level.rewards when reward.level)
level.nextLevels = (reward.level for reward in level.rewards ? [] when reward.level)
unless foundNext
for nextLevelOriginal in level.nextLevels
nextLevel = _.find levels, original: nextLevelOriginal