diff --git a/src/spectator/matchers/reference_matcher.cr b/src/spectator/matchers/reference_matcher.cr index e7907ae..74ce6e7 100644 --- a/src/spectator/matchers/reference_matcher.cr +++ b/src/spectator/matchers/reference_matcher.cr @@ -14,7 +14,7 @@ module Spectator::Matchers # Checks whether the matcher is satisifed with the expression given to it. private def match?(actual : TestExpression(T)) : Bool forall T value = expected.value - if value.responds_to?(:same?) + if value && value.responds_to?(:same?) value.same?(actual.value) else # Value type (struct) comparison.