don't call the callback twice in case it fails
Conflicts: lib/mbtiles.js
This commit is contained in:
@@ -342,10 +342,11 @@ MBTiles.prototype.getGrid = function(z, x, y, callback) {
|
||||
memo[r.key_name] = JSON.parse(r.key_json);
|
||||
return memo;
|
||||
}, {});
|
||||
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
||||
} catch (err) {
|
||||
callback(new Error('Grid is invalid'));
|
||||
return callback(new Error('Grid is invalid'));
|
||||
}
|
||||
|
||||
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user