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:
parent
5b0b5e4169
commit
10d344504a
1 changed files with 1 additions and 1 deletions
|
@ -202,7 +202,7 @@ module.exports = class TomeView extends CocoView
|
||||||
spell = @spellFor thang, spellName
|
spell = @spellFor thang, spellName
|
||||||
unless spell?.canRead()
|
unless spell?.canRead()
|
||||||
@clearSpellView()
|
@clearSpellView()
|
||||||
@updateSpellPalette thang, spell
|
@updateSpellPalette thang, spell if spell
|
||||||
return
|
return
|
||||||
unless spell.view is @spellView
|
unless spell.view is @spellView
|
||||||
@clearSpellView()
|
@clearSpellView()
|
||||||
|
|
Reference in a new issue