From: sapier Date: Sun, 6 Jul 2014 22:06:06 +0000 (+0200) Subject: Fix regression in leveldb backend X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e14c4cdd4c3c9b554dc9cb91f8f29078ad337ded;p=zefram%2Fminetest%2Fminetest_engine.git Fix regression in leveldb backend --- diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index 1b201fc1..9fe47b34 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -100,8 +100,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) std::string datastr; leveldb::Status status = m_database->Get(leveldb::ReadOptions(), i64tos(getBlockAsInteger(blockpos)), &datastr); - ENSURE_STATUS_OK(status); - if (datastr.length() == 0) { + if (datastr.length() == 0 && status.ok()) { errorstream << "Blank block data in database (datastr.length() == 0) (" << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl; @@ -112,7 +111,8 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) throw SerializationError("Blank block data in database"); } return NULL; - } else { + } + if (status.ok()) { /* Make sure sector is loaded */