[PATCH 1 of 2] Fix NPE in case the artifact does not even have the master attribute

Wald Commits scm-commit at wald.intevation.org
Tue Aug 27 18:37:28 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1377621351 -7200
# Node ID 2c8e5bad86999168ee5081ed41bebb15cea781e9
# Parent  750ce031e8e01ff3c87c92f84d0b836ea15d189d
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

diff -r 750ce031e8e0 -r 2c8e5bad8699 artifacts/src/main/java/org/dive4elements/river/themes/ThemeMapping.java
--- 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;
         }


More information about the Dive4elements-commits mailing list