mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
Return null rather than empty string
Empty string still generates the error 'Problem parsing d=""', while null results in no 'd' attribute at all.
This commit is contained in:
@@ -19,7 +19,7 @@ iD.svg = {
|
||||
}
|
||||
|
||||
if (entity.nodes.length === 0) {
|
||||
return (cache[entity.id] = '');
|
||||
return (cache[entity.id] = null);
|
||||
}
|
||||
|
||||
return (cache[entity.id] =
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user