From ef1952e953622048d1fe0fcdb70e42f7cc543e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 2 Sep 2009 06:17:19 +0000 Subject: [PATCH] make WFS protocol and format more robust, r=ahocevar (closes #2237) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9636 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WFST/v1.js | 4 +++- lib/OpenLayers/Protocol/WFS/v1.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js index 36c59948d8..fdabaf1c32 100644 --- a/lib/OpenLayers/Format/WFST/v1.js +++ b/lib/OpenLayers/Format/WFST/v1.js @@ -119,7 +119,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { data = data.documentElement; } var obj = {}; - this.readNode(data, obj); + if(data) { + this.readNode(data, obj); + } if(obj.features) { obj = obj.features; } diff --git a/lib/OpenLayers/Protocol/WFS/v1.js b/lib/OpenLayers/Protocol/WFS/v1.js index 71998da854..a6a8e7b99f 100644 --- a/lib/OpenLayers/Protocol/WFS/v1.js +++ b/lib/OpenLayers/Protocol/WFS/v1.js @@ -96,7 +96,7 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, { schema: this.schema }, this.formatOptions)); } - if(!this.featureNS) { + if(!this.featureNS && this.featurePrefix) { // featureNS autodetection var readNode = this.format.readNode; this.format.readNode = function(node, obj) {