Skip to content

Commit

Permalink
[UPD] Fix NullPointerException thrown when comparing TaskTypes for eq…
Browse files Browse the repository at this point in the history
…uality.
  • Loading branch information
kostobog committed Nov 1, 2023
1 parent cd11c7e commit 5662348
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,17 @@ public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof TaskType)) return false;
TaskType taskType = (TaskType) o;
return getCode().equals(taskType.getCode());

if(getEntityURI() != null)
return getEntityURI().equals(taskType.getEntityURI());
if(taskType.getEntityURI() != null)
return taskType.getEntityURI().equals(getEntityURI());
if(getCode() != null)
return getCode().equals(taskType.getCode());
if(taskType.getCode() != null)
return taskType.getCode().equals(getCode());

return false;
}

@Override
Expand Down

0 comments on commit 5662348

Please sign in to comment.