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.
This commit is contained in:
Binbin 2023-12-05 02:12:48 +08:00 committed by GitHub
parent 8a4ccb01b3
commit 764838d66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -436,7 +436,9 @@ sds luaCreateFunction(client *c, robj *body) {
ssize_t shebang_len = 0;
sds err = NULL;
if (evalExtractShebangFlags(body->ptr, &script_flags, &shebang_len, &err) == C_ERR) {
addReplyErrorSds(c, err);
if (c != NULL) {
addReplyErrorSds(c, err);
}
return NULL;
}