# HG changeset patch # User Tim Englich # Date 1265720749 0 # Node ID 3f39756e0c8a6d78bc3c656dab27fdd8c6f26cdb # Parent 1fb55ff633dbd2112004ee52a46fc056c2caed94 Fixed a NPE. Now it is possible to put an Mapservice without an Layer into the Request-Document of am Mapviewer-Interface-Call. gnv/trunk@667 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1fb55ff633db -r 3f39756e0c8a gnv/ChangeLog --- a/gnv/ChangeLog Fri Feb 05 14:16:03 2010 +0000 +++ b/gnv/ChangeLog Tue Feb 09 13:05:49 2010 +0000 @@ -1,3 +1,9 @@ +2010-02-09 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (createMetaDataRequestBody): + Fixed a NPE. Now it is possible to put an Mapservice without an Layer into + the Request-Document of am Mapviewer-Interface-Call. + 2010-02-05 Ingo Weinzierl Issue170 diff -r 1fb55ff633db -r 3f39756e0c8a gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Feb 05 14:16:03 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Tue Feb 09 13:05:49 2010 +0000 @@ -862,17 +862,19 @@ mapServiceNode.setAttribute("id", mapService.getID()); mapServiceNode.setAttribute("type", mapService.getType()); mapServiceNode.setAttribute("url", mapService.getURL()); - Iterator layer = mapService.getLayer().iterator(); - while (layer.hasNext()){ - Layer tmpLayer = layer.next(); - Element layerNode = this.createArtifactElement(document, - "layer"); - layerNode.setAttribute("id", tmpLayer.getID()); - layerNode.setAttribute("name", tmpLayer.getName()); - layerNode.setAttribute("isgrouplayer", - ""+tmpLayer.isGroupLayer()); - layerNode.setAttribute("parentid", tmpLayer.parentID()); - mapServiceNode.appendChild(layerNode); + if (mapService.getLayer() != null){ + Iterator layer = mapService.getLayer().iterator(); + while (layer.hasNext()){ + Layer tmpLayer = layer.next(); + Element layerNode = this.createArtifactElement(document, + "layer"); + layerNode.setAttribute("id", tmpLayer.getID()); + layerNode.setAttribute("name", tmpLayer.getName()); + layerNode.setAttribute("isgrouplayer", + ""+tmpLayer.isGroupLayer()); + layerNode.setAttribute("parentid", tmpLayer.parentID()); + mapServiceNode.appendChild(layerNode); + } } mapServicesNode.appendChild(mapServiceNode); }