Make sure superclass isn't nil

This commit is contained in:
Chris Watson 2020-03-20 16:34:37 +00:00
parent ce4fefaab2
commit e53b1167b3

View file

@ -42,7 +42,7 @@ module Spectator::Mocks
"" ""
end.id end.id
original = if (name == :new.id && receiver == "self.".id) || original = if (name == :new.id && receiver == "self.".id) ||
(t.superclass.has_method?(name) && !t.overrides?(t.superclass, name)) (t.superclass && t.superclass.has_method?(name) && !t.overrides?(t.superclass, name))
:super :super
else else
:previous_def :previous_def