Merge pull request #5400 from halaei/fix-dict-get-on-not-found

fix dict get on not found
This commit is contained in:
Salvatore Sanfilippo 2018-10-01 13:22:33 +02:00 committed by GitHub
commit 1da93f85cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4419,7 +4419,7 @@ int RM_DictReplace(RedisModuleDict *d, RedisModuleString *key, void *ptr) {
void *RM_DictGetC(RedisModuleDict *d, void *key, size_t keylen, int *nokey) {
void *res = raxFind(d->rax,key,keylen);
if (nokey) *nokey = (res == raxNotFound);
return res;
return (res == raxNotFound) ? NULL : res;
}
/* Like RedisModule_DictGetC() but takes the key as a RedisModuleString. */