Skip to content

Commit

Permalink
Merge pull request #35 from dityas/dev
Browse files Browse the repository at this point in the history
Log null children while pre computing hashes
  • Loading branch information
dityas authored Dec 30, 2019
2 parents 565e9cb + 69816dc commit f232a24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Binary file modified Protos/build/Protos.jar
Binary file not shown.
10 changes: 8 additions & 2 deletions Protos/src/thinclab/legacy/DDnode.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ private void precomputeHash() {
HashCodeBuilder builder = new HashCodeBuilder();
builder.append(this.var);

for (int i=0; i<children.length; i++)
builder.append(this.children[i].hashCode());
for (int i=0; i<children.length; i++) {

/* check for null children, if this happens, something is wrong */
if (this.children[i] != null)
builder.append(this.children[i].hashCode());

else logger.error("Null child at " + i + " something might be seriously wrong.");
}

this.hash = builder.toHashCode();
}
Expand Down

0 comments on commit f232a24

Please sign in to comment.