From 916c4e5d864f55949e0202d2d9a073e19cf49b72 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 27 Sep 2019 18:42:38 +0200 Subject: [PATCH] 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. --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }