Browse Source

guard against ft_curckt->ci_ckt == NULL

pre-master-46
Holger Vogt 6 years ago
parent
commit
d8085ed594
  1. 2
      src/frontend/com_option.c
  2. 2
      src/frontend/inventory.c
  3. 2
      src/frontend/options.c

2
src/frontend/com_option.c

@ -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;
}

2
src/frontend/inventory.c

@ -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;
}

2
src/frontend/options.c

@ -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 {

Loading…
Cancel
Save