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.
This commit is contained in:
antirez 2019-09-27 18:42:38 +02:00
parent 8b5848a4f5
commit 916c4e5d86

View File

@ -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;
}