Add check to TomeView

Found a bug while playing Ogre Encampment: click the Chest before clicking past the
intro screen and the game throws an error, when `updateSpellPalette` tries to access
call `spell.getSource()` but `spell` is undefined. This check keeps the same behavior
but handles the error.
This commit is contained in:
Scott Erickson 2016-07-08 13:27:42 -07:00
parent 5b0b5e4169
commit 10d344504a

View file

@ -202,7 +202,7 @@ module.exports = class TomeView extends CocoView
spell = @spellFor thang, spellName
unless spell?.canRead()
@clearSpellView()
@updateSpellPalette thang, spell
@updateSpellPalette thang, spell if spell
return
unless spell.view is @spellView
@clearSpellView()