diff options
-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) |