CommandFilter API: fix UnregisterCommandFilter.

This commit is contained in:
Yossi Gottlieb 2019-03-21 19:45:41 +02:00
parent e2626f69ec
commit 4ea3ed896b

View File

@ -4887,9 +4887,8 @@ int RM_UnregisterCommandFilter(RedisModuleCtx *ctx, RedisModuleCommandFilter *fi
listDelNode(moduleCommandFilters,ln);
ln = listSearchKey(ctx->module->filters,filter);
if (ln) {
listDelNode(moduleCommandFilters,ln);
}
if (!ln) return REDISMODULE_ERR; /* Shouldn't happen */
listDelNode(ctx->module->filters,ln);
return REDISMODULE_OK;
}