aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-09-26 23:29:08 +0200
committerest31 <MTest31@outlook.com>2015-09-26 23:42:55 +0200
commit4338f100f84100f5779d4e12fe23d359f94ef718 (patch)
tree28f0a0d5ae778b3b2bc99954ad119b37307be0a5
parent88a44122abdef9c23c5ab984742f12e4fbd41188 (diff)
downloadminetest-4338f100f84100f5779d4e12fe23d359f94ef718.tar.gz
minetest-4338f100f84100f5779d4e12fe23d359f94ef718.tar.bz2
minetest-4338f100f84100f5779d4e12fe23d359f94ef718.zip
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".
-rw-r--r--src/database-redis.cpp5
1 files changed, 5 insertions, 0 deletions
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