diff options
author | David Gay <david@davidgay.org> | 2021-05-28 20:23:16 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-28 20:23:16 -0400 |
commit | caf400c7be1d7e46fc0b9210356b8516e6545551 (patch) | |
tree | db8335328210426da3667a73473f54f25ce9897b /app/models | |
parent | 4a56d290332fecc982087518d0bf6e05b4b677ef (diff) |
Fix bug with new `#trophy_monster_id`
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index 26671f3..8913f71 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -84,7 +84,11 @@ class Character < ApplicationRecord def trophy_monster_gid equipment = self.equipment.joins(:item).where("items.gid like ?", "%_trophy").first - equipment.item.gid.split("_trophy").first + if equipment + equipment.item.gid.split("_trophy").first + else + nil + end end def equip(item) |