From f2bdc462a3f4622ca205d0fb0c1036f05c838106 Mon Sep 17 00:00:00 2001 From: Mikael Capelle Date: Fri, 9 Mar 2018 21:08:00 +0100 Subject: [PATCH] Fix .equals for Node. --- src/main/org/insa/graph/Node.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/org/insa/graph/Node.java b/src/main/org/insa/graph/Node.java index 33ee579..8aadf84 100644 --- a/src/main/org/insa/graph/Node.java +++ b/src/main/org/insa/graph/Node.java @@ -95,6 +95,9 @@ public class Node implements Comparable { @Override public boolean equals(Object other) { + if (other == null) { + return false; + } if (other instanceof Node) { return getId() == ((Node) other).getId(); }