ensure keys are strings before inserting into sqlite - closes #20
This commit is contained in:
+5
-1
@@ -549,7 +549,11 @@ MBTiles.prototype.putTile = function(z, x, y, data, callback) {
|
|||||||
|
|
||||||
// Tilelive may pass us a data.key. If not, generate an md5
|
// Tilelive may pass us a data.key. If not, generate an md5
|
||||||
// from the image buffer data.
|
// from the image buffer data.
|
||||||
var id = data.key || crypto.createHash('md5').update(data).digest('hex');
|
var id;
|
||||||
|
if (data.key)
|
||||||
|
id = String(data.key);
|
||||||
|
else
|
||||||
|
id = crypto.createHash('md5').update(data).digest('hex');
|
||||||
if (!this._tileCache[id]) {
|
if (!this._tileCache[id]) {
|
||||||
// This corresponds to the images table.
|
// This corresponds to the images table.
|
||||||
this._tileCache[id] = data;
|
this._tileCache[id] = data;
|
||||||
|
|||||||
Reference in New Issue
Block a user