# HG changeset patch # User Ingo Weinzierl # Date 1325772907 0 # Node ID aa9cc91c8193e7bd57f4a08fd03ce7cd3a86f567 # Parent 0553e31d25e7a119eb29d6fbc4b0713c81370d34 #444 Take care on NullPointerExceptions in getWQMode. Take 'false' as default value if no 'wq_free' item is existing. flys-artifacts/trunk@3597 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0553e31d25e7 -r aa9cc91c8193 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jan 05 13:55:17 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jan 05 14:15:07 2012 +0000 @@ -1,3 +1,10 @@ +2012-01-05 Ingo Weinzierl + + flys/issue444 (error_no_export_found bei "W bei ungleichwertigem Abfluss") + + * src/main/java/de/intevation/flys/utils/FLYSUtils.java: If no boolean + value "wq_free" exists in getWQMode(), false is the default. + 2011-01-05 Felix Wolfsteller flys/issue443 (Querprofile: Hibernate LazyInitializationException) diff -r 0553e31d25e7 -r aa9cc91c8193 flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java --- a/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Thu Jan 05 13:55:17 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Thu Jan 05 14:15:07 2012 +0000 @@ -157,8 +157,14 @@ * @return an enum WQ_MODE. */ public static WQ_MODE getWQMode(FLYSArtifact flys) { + if (flys == null) { + return WQ_MODE.NONE; + } + String mode = flys.getDataAsString("wq_mode"); - boolean free = flys.getDataAsBoolean("wq_free"); + Boolean free = flys.getDataAsBoolean("wq_free"); + + free = free != null ? free : false; if (mode != null && mode.equals("Q")) { return free ? WQ_MODE.QFREE : WQ_MODE.QGAUGE;