Skip to content

Commit

Permalink
Always return valid object in getPoints
Browse files Browse the repository at this point in the history
Otherwise line 276 and 277 will cause a TypeError.
  • Loading branch information
TheMarex committed Jan 19, 2015
1 parent 3e58087 commit bfec724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion togeojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ toGeoJSON = (function() {
function getPoints(node, pointname) {
var pts = get(node, pointname), line = [], times = [],
l = pts.length;
if (l < 2) return; // Invalid line in GeoJSON
if (l < 2) return {}; // Invalid line in GeoJSON
for (var i = 0; i < l; i++) {
var c = coordPair(pts[i]);
line.push(c.coordinates);
Expand Down

0 comments on commit bfec724

Please sign in to comment.