From 1bc028c7a3507bdfa73d04344b8822c6ae2a62cd Mon Sep 17 00:00:00 2001 From: David Berdik Date: Sun, 14 Apr 2019 17:55:07 -0400 Subject: [PATCH] Fixed occasional "NullPointerException" occurring when using the experiment engine --- src/com/jgaap/backend/ExperimentEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jgaap/backend/ExperimentEngine.java b/src/com/jgaap/backend/ExperimentEngine.java index 615256911..3f6046a86 100644 --- a/src/com/jgaap/backend/ExperimentEngine.java +++ b/src/com/jgaap/backend/ExperimentEngine.java @@ -253,7 +253,7 @@ public String call() throws Exception { Path filePath = FileSystems.getDefault().getPath(fileName); Writer writer = Files.newBufferedWriter(filePath, Charset.defaultCharset(), StandardOpenOption.CREATE); for (Document resultDocument : resultDocuments) { - if (!resultDocument.getFormattedResult(analysisDriver).equals("null")) + if (resultDocument.getFormattedResult(analysisDriver) != null && !resultDocument.getFormattedResult(analysisDriver).equals("null")) writer.append(resultDocument.getFormattedResult(analysisDriver)); } writer.close();