From 4338f100f84100f5779d4e12fe23d359f94ef718 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 26 Sep 2015 23:29:08 +0200 Subject: 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: 524a7656e3e5cd671b05c13e2ad69cb84bad0423 "redis: throw error if block request failed" Now we branch out on the valid reply type "not found". --- src/database-redis.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/database-redis.cpp') diff --git a/src/database-redis.cpp b/src/database-redis.cpp index d7f537977..9e47b516f 100644 --- a/src/database-redis.cpp +++ b/src/database-redis.cpp @@ -126,6 +126,11 @@ std::string Database_Redis::loadBlock(const v3s16 &pos) throw FileNotGoodException(std::string( "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) << " returned invalid reply type " << reply->type -- cgit v1.2.3