Fix regression in leveldb backend
authorsapier <Sapier at GMX dot net>
Sun, 6 Jul 2014 22:06:06 +0000 (00:06 +0200)
committersapier <Sapier at GMX dot net>
Sun, 6 Jul 2014 22:06:06 +0000 (00:06 +0200)
src/database-leveldb.cpp

index 1b201fc1ac5a79b36ea74d1b8d65988f442095dd..9fe47b34ec9f9920dea439286df67dcacad58613 100644 (file)
@@ -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
                */