diff --git a/src/main/java/com/esaulpaugh/headlong/abi/ContractError.java b/src/main/java/com/esaulpaugh/headlong/abi/ContractError.java index 98977d788..47779d594 100644 --- a/src/main/java/com/esaulpaugh/headlong/abi/ContractError.java +++ b/src/main/java/com/esaulpaugh/headlong/abi/ContractError.java @@ -61,10 +61,11 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ContractError that = (ContractError) o; - return name.equals(that.name) && inputs.equals(that.inputs); + if (o instanceof ContractError) { + ContractError that = (ContractError) o; + return name.equals(that.name) && inputs.equals(that.inputs); + } + return false; } public static ContractError fromJson(String errorJson) {