diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2018-10-01 13:22:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 13:22:33 +0200 |
commit | 1da93f85cc553ae5cc80488b5d9aed1d3499b647 (patch) | |
tree | ac82aae9352804c5d1cc2cf230f118977c7cd650 | |
parent | 9e0e5ccbf4600bde74309bd6de3e6a722357498e (diff) | |
parent | 86fb7b20bfb4bb29a73b48a483d487749bd41de4 (diff) | |
download | redis-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.c | 2 |
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. */ |