diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js index db975f2be9..2b644d48f3 100644 --- a/lib/OpenLayers/Format/OWSCommon.js +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -66,7 +66,7 @@ OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML, { // remember version does not correspond to the OWS version // it corresponds to the WMS/WFS/WCS etc. request version var uri = root.getAttribute("xmlns:ows"); - if (uri.substring(uri.lastIndexOf("/")+1) === "1.1") { + if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") { version ="1.1.0"; } if(!version) {