summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-10-01 13:22:33 +0200
committerGitHub <noreply@github.com>2018-10-01 13:22:33 +0200
commit1da93f85cc553ae5cc80488b5d9aed1d3499b647 (patch)
treeac82aae9352804c5d1cc2cf230f118977c7cd650
parent9e0e5ccbf4600bde74309bd6de3e6a722357498e (diff)
parent86fb7b20bfb4bb29a73b48a483d487749bd41de4 (diff)
downloadredis-1da93f85cc553ae5cc80488b5d9aed1d3499b647.tar.gz
Merge pull request #5400 from halaei/fix-dict-get-on-not-found
fix dict get on not found
-rw-r--r--src/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c
index 2be07ca77..81b04f075 100644
--- a/src/module.c
+++ b/src/module.c
@@ -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. */