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