Skip to content

Commit fbd9007

Browse files
committed
Corrected Neighbor to support (de)serialization
1 parent 6969e2f commit fbd9007

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/info/debatty/java/graphs/Neighbor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public int hashCode() {
7171

7272
@Override
7373
public int compareTo(Object other) {
74+
if (other == null) {
75+
return 1;
76+
}
77+
7478
if (!other.getClass().isInstance(this)) {
7579
throw new InvalidParameterException();
7680
}

0 commit comments

Comments
 (0)