From 103360c35e307debee433b21e58aeeb26298a0d2 Mon Sep 17 00:00:00 2001 From: Alex Birkett Date: Mon, 2 Feb 2015 17:33:25 +0100 Subject: [PATCH] Fix NullPointerException when tag.other is null --- src/main/java/no/birkett/kiwi/Solver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/no/birkett/kiwi/Solver.java b/src/main/java/no/birkett/kiwi/Solver.java index c150020..ccb6522 100644 --- a/src/main/java/no/birkett/kiwi/Solver.java +++ b/src/main/java/no/birkett/kiwi/Solver.java @@ -219,7 +219,7 @@ public class Solver { if (row.coefficientFor(tag.marker) < 0.0) return tag.marker; } - if (tag.other.getType() == Symbol.Type.SLACK || tag.other.getType() == Symbol.Type.ERROR) { + if (tag.other != null && (tag.other.getType() == Symbol.Type.SLACK || tag.other.getType() == Symbol.Type.ERROR)) { if (row.coefficientFor(tag.other) < 0.0) return tag.other; }