diff --git a/js/id/svg.js b/js/id/svg.js index bf73f32b8..e2b1dc2ad 100644 --- a/js/id/svg.js +++ b/js/id/svg.js @@ -19,7 +19,7 @@ iD.svg = { } if (entity.nodes.length === 0) { - return (cache[entity.id] = ''); + return (cache[entity.id] = null); } return (cache[entity.id] = diff --git a/test/spec/svg.js b/test/spec/svg.js index bbb78c990..265562071 100644 --- a/test/spec/svg.js +++ b/test/spec/svg.js @@ -7,4 +7,11 @@ describe("iD.svg.LineString", function () { expect(iD.svg.LineString(projection)(way)).to.equal("M0,0L2,3"); }); + + it("returns null for an entity with no nodes", function () { + var way = iD.Way(), + projection = Object; + + expect(iD.svg.LineString(projection)(way)).to.be.null; + }); });