changeset 1103:ca599ec3ee79

Fixed NPE in error listener.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 24 Oct 2016 11:54:53 +0200
parents 341911ecc9e0
children 657f35a7467d
files src/main/java/de/intevation/lada/importer/laf/LafErrorListener.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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());
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)