Handle missing table errors gracefully in getGeocoderData

This commit is contained in:
Young Hahn
2015-10-29 15:39:04 -04:00
parent da3c7327de
commit 86ba2021fd

View File

@@ -600,6 +600,7 @@ MBTiles.prototype.putInfo = function(data, callback) {
// Implements carmen#getGeocoderData method.
MBTiles.prototype.getGeocoderData = function(type, shard, callback) {
return this._db.get('SELECT data FROM geocoder_data WHERE type = ? AND shard = ?', type, shard, function(err, row) {
if (err && err.code === 'SQLITE_ERROR' && err.errno === 1) return callback();
if (err) return callback(err);
if (!row) return callback();
zlib.inflate(row.data, callback);