diff --git a/tools/vsh.c b/tools/vsh.c index 5e2e3ac219..11f493f969 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -1031,7 +1031,7 @@ vshCommandOptStringReq(vshControl *ctl, /* this should not be propagated here, just to be sure */ if (ret == -1) error = N_("Mandatory option not present"); - else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) + else if (arg && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) error = N_("Option argument is empty"); if (error) {