Skip to content

Commit

Permalink
fix NPE in DataList/DataMap equals & asString (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlyhj committed Jun 4, 2023
1 parent 9a29682 commit 533f41a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public String asString() {
} else {
output.append(", ");
}
output.append(value.toString());
output.append(value);
}
output.append(']');
return output.toString();
Expand Down Expand Up @@ -169,6 +169,7 @@ private boolean containsList(List<IData> dataValues) {
@Override
public boolean equals(IData data) {
List<IData> otherValues = data.asList();
if (data.asList() == null) return false;
if(otherValues.size() != values.size())
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public String asString() {
}

result.append(": ");
result.append(entry.getValue().toString());
result.append(entry.getValue());
}
result.append('}');
return result.toString();
Expand Down Expand Up @@ -245,6 +245,7 @@ public boolean equals(IData data) {
return true;

Map<String, IData> dataMap = data.asMap();
if (dataMap == null) return false;
if(dataMap.size() != this.data.size())
return false;

Expand Down

0 comments on commit 533f41a

Please sign in to comment.