From dd2dab37a7e08a39fedbe14bda32454dd4b1bb83 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 21 Aug 2023 15:49:04 +0700 Subject: [PATCH] Account for case when both references refer to null --- .../ru/dbotthepony/mc/otm/core/collect/ReferenceHashStrategy.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/ReferenceHashStrategy.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/ReferenceHashStrategy.kt index d6b6fdc3c..eb3e61200 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/ReferenceHashStrategy.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/ReferenceHashStrategy.kt @@ -9,7 +9,7 @@ object ReferenceHashStrategy : Hash.Strategy { if (a == null || b == null) return false if (a is Reference<*>) { - if (b is Reference<*>) return a.get() == b.get() + if (b is Reference<*>) return a.get() != null && a.get() == b.get() return a.get() == b } else if (b is Reference<*>) { return b.get() == a