From 393f087e7e3d2e3a636ae0ffeb075c2354ff0966 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Tue, 31 Dec 2019 14:54:02 +0100 Subject: Handle removed queries in Qurnik --- .../java/pl/edu/mimuw/cloudatlas/agent/modules/Qurnik.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/pl/edu/mimuw') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Qurnik.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Qurnik.java index 9b7268a..1ab8a16 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Qurnik.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Qurnik.java @@ -80,13 +80,15 @@ public class Qurnik extends Module { Interpreter interpreter = new Interpreter(zmi); AttributesMap newAttributes = new AttributesMap(); for (ValueQuery query : queries) { - try { - List result = interpreter.interpretProgram(query.getQuery()); - for(QueryResult r : result) { - newAttributes.addOrChange(r.getName(), r.getValue()); + if (query != null) { + try { + List result = interpreter.interpretProgram(query.getQuery()); + for(QueryResult r : result) { + newAttributes.addOrChange(r.getName(), r.getValue()); + } + } catch(InterpreterException exception) { + System.out.println("ERROR: thrown while running interpreter: " + exception.getMessage()); } - } catch(InterpreterException exception) { - System.out.println("ERROR: thrown while running interpreter: " + exception.getMessage()); } } -- cgit v1.2.3