Commit b362a1b7 authored by Hamid Alaei's avatar Hamid Alaei Committed by antirez
Browse files

fix dict get on not found

parent 55e9df8a
...@@ -4419,7 +4419,7 @@ int RM_DictReplace(RedisModuleDict *d, RedisModuleString *key, void *ptr) { ...@@ -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 *RM_DictGetC(RedisModuleDict *d, void *key, size_t keylen, int *nokey) {
void *res = raxFind(d->rax,key,keylen); void *res = raxFind(d->rax,key,keylen);
if (nokey) *nokey = (res == raxNotFound); if (nokey) *nokey = (res == raxNotFound);
return res; return (res == raxNotFound) ? NULL : res;
} }
/* Like RedisModule_DictGetC() but takes the key as a RedisModuleString. */ /* Like RedisModule_DictGetC() but takes the key as a RedisModuleString. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment