Doh. Only delete from cache if there is an error.

This commit is contained in:
Will White
2011-10-06 11:57:28 -04:00
parent d546f64668
commit 12a2b6ab31

View File

@@ -61,7 +61,7 @@ function MBTiles(uri, callback) {
var mbtiles = cache[key];
if (!mbtiles.open && !mbtiles.error) {
mbtiles.once('open', function(err, mbtiles) {
delete cache[key];
if (err) delete cache[key];
callback(err, mbtiles);
});
} else {