diff --git a/lib/OpenLayers/Format/GeoRSS.js b/lib/OpenLayers/Format/GeoRSS.js index 97fda1ab32..89c8e911b8 100644 --- a/lib/OpenLayers/Format/GeoRSS.js +++ b/lib/OpenLayers/Format/GeoRSS.js @@ -155,7 +155,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, { geometry = feature.geometry; } - if (this.internalProjection && this.externalProjection) { + if (geometry && this.internalProjection && this.externalProjection) { geometry.transform(this.externalProjection, this.internalProjection); } diff --git a/tests/Format/test_GeoRSS.html b/tests/Format/test_GeoRSS.html index 0f9828a88a..02272bd48a 100644 --- a/tests/Format/test_GeoRSS.html +++ b/tests/Format/test_GeoRSS.html @@ -35,6 +35,13 @@ t.eq(data[0].geometry.x, -1, "w3c geo x read correctly"); t.eq(data[0].geometry.y, 1, "w3c geo y read correctly"); } + function test_Format_GeoRSS_reproject_null(t) { + t.plan(1); + + var parser = new OpenLayers.Format.GeoRSS({'internalProjection':new OpenLayers.Projection("EPSG:4326"), 'externalProjection': new OpenLayers.Projection("EPSG:4326")}); + var data = parser.read(''); + t.eq(data.length, 1, "Parsing items with null geometry and reprojection doesn't fail"); + } function test_Format_GeoRSS_roundtrip(t) { t.plan(input.length); var parser = new OpenLayers.Format.GeoRSS();