diff artifacts/src/main/java/org/dive4elements/river/themes/ThemeMapping.java @ 6931:2c8e5bad8699

Fix NPE in case the artifact does not even have the master attribute Started happening with the new other.wqkms.w attribute condition and official lines in waterlevel calculations
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 27 Aug 2013 18:35:51 +0200
parents af13ceeba52a
children e4606eae8ea5
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/themes/ThemeMapping.java	Tue Aug 27 16:16:13 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/themes/ThemeMapping.java	Tue Aug 27 18:35:51 2013 +0200
@@ -133,7 +133,8 @@
         }
 
         // Test.
-        if (artifact.getDataAsString(parts[0]).equals(parts[1])) {
+        String artData = artifact.getDataAsString(parts[0]);
+        if (artData != null && artData.equals(parts[1])) {
             logger.debug("Matches master Attribute.");
             return true;
         }

http://dive4elements.wald.intevation.org