safety check

This commit is contained in:
Andrew Brown 2019-12-14 10:35:46 -06:00
parent 9f106441d8
commit ce82ea6ef7

View File

@ -19,6 +19,6 @@ class Mothership < ApplicationRecord
this_object = Character.find_by(id: self.character_id)
other_object = Character.find_by(id: self.mother_id)
other_object.children.delete(this_object) if other_object.present?
other_object.children.delete(this_object) if other_object.present? && this_object.present?
end
end