[Lada-commits] [PATCH 5 of 5] Fixed NPE in error listener

Wald Commits scm-commit at wald.intevation.org
Mon Oct 24 11:55:03 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1477302893 -7200
# Node ID ca599ec3ee799307ec77ae3106b77e39b7a209af
# Parent  341911ecc9e05eb3bb3ae73551e01eaac34c9b14
Fixed NPE in error listener.

diff -r 341911ecc9e0 -r ca599ec3ee79 src/main/java/de/intevation/lada/importer/laf/LafErrorListener.java
--- a/src/main/java/de/intevation/lada/importer/laf/LafErrorListener.java	Mon Oct 24 11:54:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/LafErrorListener.java	Mon Oct 24 11:54:53 2016 +0200
@@ -20,7 +20,10 @@
                             int line, int charPositionInLine,
                             String msg, RecognitionException e)
     {
-        String sourceName = e.getCtx().getText();
+    	String sourceName = "Parser";
+    	if (e != null && e.getCtx() != null) {
+    	    sourceName = e.getCtx().getText();
+    	}
         ReportItem err = new ReportItem();
         err.setKey(sourceName);
         err.setValue(line + ":" + charPositionInLine + " - " + e.getOffendingToken().getText());


More information about the Lada-commits mailing list