diff --git a/common/src/main/java/net/william278/husksync/data/Identifier.java b/common/src/main/java/net/william278/husksync/data/Identifier.java index bf915f9a..06799b66 100644 --- a/common/src/main/java/net/william278/husksync/data/Identifier.java +++ b/common/src/main/java/net/william278/husksync/data/Identifier.java @@ -25,6 +25,7 @@ import org.intellij.lang.annotations.Subst; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.Comparator; @@ -229,11 +230,8 @@ public String toString() { * @return {@code true} if the given object is an identifier with the same key as this identifier */ @Override - public boolean equals(Object obj) { - if (obj instanceof Identifier other) { - return key.equals(other.key); - } - return false; + public boolean equals(@Nullable Object obj) { + return obj instanceof Identifier other ? toString().equals(other.toString()) : super.equals(obj); } // Get the config entry for the identifier