From 48e6e658d0e6272c11d8125bba8c8d1a3337ad42 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 5 Aug 2017 15:59:49 -0700 Subject: [PATCH] Fix mismatched parentheses causing exceptions. --- src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java b/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java index 6239ed9..e6e930d 100644 --- a/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java +++ b/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java @@ -162,6 +162,7 @@ public class ShuntingYardParser implements Parser>, PluginListe @Override public TreeNode constructTree(List> tokens) { tokens = intoPostfix(new ArrayList<>(tokens)); + if(tokens == null) return null; Collections.reverse(tokens); return constructRecursive(tokens); }