NPE on keyword parsing from remote WMS
--------------------------------------
Key: GEOS-4798
URL: https://jira.codehaus.org/browse/GEOS-4798
Project: GeoServer
Issue Type: Bug
Components: Configuration
Reporter: Gabriel Roldán
Assignee: Justin Deoliveira
Fix For: 2.1.3
This bug report comes from the GeoNode world with the following stack traces:
http://dpaste.de/VwSWk/
http://dpaste.de/N5b2d/
The issue is simple: don't ask me why, but there are WMS instances whose capabilities have layers with null keywords.
The fix would be as simple as a null check here:
{code}
diff --git a/main/src/main/java/org/geoserver/catalog/CatalogBuilder.java b/main/src/main/java/org/geoserver/catalog/CatalogBuilder.java
index 2c27d8c..713ef95 100644
--- a/main/src/main/java/org/geoserver/catalog/CatalogBuilder.java
+++ b/main/src/main/java/org/geoserver/catalog/CatalogBuilder.java
@@ -1085,7 +1085,9 @@ public class CatalogBuilder {
wli.setTitle(layer.getTitle());
if (layer.getKeywords() != null) {
for (String kw : layer.getKeywords()) {
- wli.getKeywords().add(new Keyword(kw));
+ if(kw != null){
+ wli.getKeywords().add(new Keyword(kw));
+ }
}
}
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira