From: Johannes Schindelin <johannes.schindelin@xxxxxx> As pointed out by CodeQL, it could be NULL and we usually check for that. Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx> --- builtin/submodule--helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index c1a8029714bf..55826b82407c 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1934,6 +1934,9 @@ static int determine_submodule_update_strategy(struct repository *r, const char *val; int ret; + if (!sub) + return error(_("could not retrieve submodule information for path '%s'"), path); + key = xstrfmt("submodule.%s.update", sub->name); if (update) { -- gitgitgadget