1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 14:55:13 -05:00

Fix redis erroring on non found blocks

Thanks to @netinetwalker for spotting the error, proposing a fix, and testing it.

Error due to @est31's merging changes to PR #3202 to add more error reporting for invalid reply types, commit:

524a7656e3 "redis: throw error if block request failed"

Now we branch out on the valid reply type "not found".
This commit is contained in:
est31 2015-09-26 23:29:08 +02:00
parent 88a44122ab
commit 4338f100f8

View File

@ -126,6 +126,11 @@ std::string Database_Redis::loadBlock(const v3s16 &pos)
throw FileNotGoodException(std::string( throw FileNotGoodException(std::string(
"Redis command 'HGET %s %s' errored: ") + errstr); "Redis command 'HGET %s %s' errored: ") + errstr);
} }
case REDIS_REPLY_NIL: {
// block not found in database
freeReplyObject(reply);
return "";
}
} }
errorstream << "loadBlock: loading block " << PP(pos) errorstream << "loadBlock: loading block " << PP(pos)
<< " returned invalid reply type " << reply->type << " returned invalid reply type " << reply->type