Unverified Commit 764838d6 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Check whether the client is NULL in luaCreateFunction (#12829)

It was first added to load lua from RDB, see 28dfdca7. After #9812,
we no longer save lua in RDB. luaCreateFunction will only be called
in script load and eval*, both of which are available in the client.

It could be that that some day we'll still want to load scripts from
somewhere that's not a client. This fix is in dead code.
parent 8a4ccb01
...@@ -436,7 +436,9 @@ sds luaCreateFunction(client *c, robj *body) { ...@@ -436,7 +436,9 @@ sds luaCreateFunction(client *c, robj *body) {
ssize_t shebang_len = 0; ssize_t shebang_len = 0;
sds err = NULL; sds err = NULL;
if (evalExtractShebangFlags(body->ptr, &script_flags, &shebang_len, &err) == C_ERR) { if (evalExtractShebangFlags(body->ptr, &script_flags, &shebang_len, &err) == C_ERR) {
addReplyErrorSds(c, err); if (c != NULL) {
addReplyErrorSds(c, err);
}
return NULL; return NULL;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment