diff options
author | antirez <antirez@gmail.com> | 2019-09-27 18:42:38 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-09-27 18:42:38 +0200 |
commit | 916c4e5d864f55949e0202d2d9a073e19cf49b72 (patch) | |
tree | fac1e24038517e791f59876b9025c366f72af0e3 | |
parent | 8b5848a4f50f2fb0d9651ea91b74b22e83e6a452 (diff) | |
download | redis-916c4e5d864f55949e0202d2d9a073e19cf49b72.tar.gz |
moduleRDBLoadError(): io->ctx may be NULL.
The correct way to access the module about a given IO context is to
deference io->type->module, since io->ctx is only populated if the user
requests an explicit context from an IO object.
-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 351ffcc45..8e9ffbf87 100644 --- a/src/module.c +++ b/src/module.c @@ -3177,7 +3177,7 @@ void *RM_ModuleTypeGetValue(RedisModuleKey *key) { * modules this cannot be recovered, but if the module declared capability * to handle errors, we'll raise a flag rather than exiting. */ void moduleRDBLoadError(RedisModuleIO *io) { - if (io->ctx->module->options & REDISMODULE_OPTIONS_HANDLE_IO_ERRORS) { + if (io->type->module->options & REDISMODULE_OPTIONS_HANDLE_IO_ERRORS) { io->error = 1; return; } |