Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java @ 6962:234b1a3b527d
Workaround for flys/issue14070. TODO: Find the reason why a null document is given to the ThemeDocument.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 04 Sep 2013 10:53:53 +0200 |
parents | 058b8dc4e8b6 |
children | 988dde49ae65 |
comparison
equal
deleted
inserted
replaced
6961:6bc333c162d1 | 6962:234b1a3b527d |
---|---|
130 return values.get(key); | 130 return values.get(key); |
131 } | 131 } |
132 | 132 |
133 private static Map<String, String> extractValues(Document document) { | 133 private static Map<String, String> extractValues(Document document) { |
134 Map<String, String> values = new HashMap<String, String>(); | 134 Map<String, String> values = new HashMap<String, String>(); |
135 if (document == null) { | |
136 logger.error("Invalid null document given."); | |
137 return values; | |
138 } | |
139 | |
135 NodeList fields = document.getElementsByTagName("field"); | 140 NodeList fields = document.getElementsByTagName("field"); |
136 for (int i = 0, N = fields.getLength(); i < N; ++i) { | 141 for (int i = 0, N = fields.getLength(); i < N; ++i) { |
137 Element field = (Element)fields.item(i); | 142 Element field = (Element)fields.item(i); |
138 String name = field.getAttribute("name"); | 143 String name = field.getAttribute("name"); |
139 String value = field.getAttribute("default"); | 144 String value = field.getAttribute("default"); |