From caf400c7be1d7e46fc0b9210356b8516e6545551 Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 28 May 2021 20:23:16 -0400 Subject: Fix bug with new `#trophy_monster_id` --- app/models/character.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3