diff --git a/subsys/shell/shell_utils.c b/subsys/shell/shell_utils.c index 0f4045b9bb2..844c0fc6db0 100644 --- a/subsys/shell/shell_utils.c +++ b/subsys/shell/shell_utils.c @@ -248,7 +248,6 @@ const struct shell_static_entry *shell_cmd_get( size_t idx, struct shell_static_entry *dloc) { - __ASSERT_NO_MSG(dloc != NULL); const struct shell_static_entry *res = NULL; if (parent == NULL) { @@ -256,6 +255,8 @@ const struct shell_static_entry *shell_cmd_get( shell_root_cmd_get(idx)->u.entry : NULL; } + __ASSERT_NO_MSG(dloc != NULL); + if (parent->subcmd) { if (parent->subcmd->is_dynamic) { parent->subcmd->u.dynamic_get(idx, dloc);