From c44e80730afdf47e94bab18534a8af4b94a57944 Mon Sep 17 00:00:00 2001 From: lwx1281857 Date: Fri, 24 Jan 2025 15:11:24 +0800 Subject: [PATCH] Description: Code optimization Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: lwx1281857 --- services/begetctl/begetctl_cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/begetctl/begetctl_cmd.c b/services/begetctl/begetctl_cmd.c index d4413c5bd..8c521cbed 100644 --- a/services/begetctl/begetctl_cmd.c +++ b/services/begetctl/begetctl_cmd.c @@ -54,6 +54,10 @@ static int HandleCmd(BShellHandle shell, const char *cmdName, int argc, char **a static int SetInitLogLevelFromParam(BShellHandle shell, int argc, char **argv) { + if (argv == NULL) { + BSH_LOGE("SetInitLogLevelFromParam Failed, argv is NULL"); + return -1; + } if (argc != 2) { // 2 is set log level parameter number char *helpArgs[] = {"set", NULL}; BShellCmdHelp(shell, 1, helpArgs);