guard against ft_curckt->ci_ckt == NULL

This commit is contained in:
Holger Vogt 2020-04-13 17:04:43 +02:00
parent 11b22c8f46
commit d8085ed594
3 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ com_option(wordlist *wl)
CKTcircuit *circuit = NULL;
if (!ft_curckt) {
if (!ft_curckt || !ft_curckt->ci_ckt) {
fprintf(cp_err, "Error: no circuit loaded\n");
return;
}

View File

@ -30,7 +30,7 @@ com_inventory(wordlist *wl)
NG_IGNORE(wl);
if (!ft_curckt) {
if (!ft_curckt || !ft_curckt->ci_ckt) {
fprintf(cp_err, "There is no current circuit\n");
return;
}

View File

@ -430,7 +430,7 @@ cp_usrset(struct variable *var, bool isset)
return (0);
}
if (ft_curckt) {
if (ft_curckt && ft_curckt->ci_ckt) {
if (if_option(ft_curckt->ci_ckt, var->va_name, var->va_type, vv))
return US_SIMVAR;
} else {