Skip to content

Commit 4338f10

Browse files
committedSep 26, 2015
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: 524a765 "redis: throw error if block request failed" Now we branch out on the valid reply type "not found".
1 parent 88a4412 commit 4338f10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/database-redis.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ std::string Database_Redis::loadBlock(const v3s16 &pos)
126126
throw FileNotGoodException(std::string(
127127
"Redis command 'HGET %s %s' errored: ") + errstr);
128128
}
129+
case REDIS_REPLY_NIL: {
130+
// block not found in database
131+
freeReplyObject(reply);
132+
return "";
133+
}
129134
}
130135
errorstream << "loadBlock: loading block " << PP(pos)
131136
<< " returned invalid reply type " << reply->type

0 commit comments

Comments
 (0)
Please sign in to comment.