diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 380bd9fac..8397c4852 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -468,7 +468,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) /* called with *fp == NULL and not intfile: we want to reload circuit from mc_deck */ else { /* re-load deck due to command 'reset' via function inp_source_recent() */ - if (mc_reload) { + if (mc_reload && mc_deck) { deck = inp_deckcopy(mc_deck); expr_w_temper = TRUE; mc_reload = FALSE; @@ -479,14 +479,14 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) deck = inp_deckcopy(ft_curckt->ci_mcdeck); expr_w_temper = TRUE; } - /* re-load input deck from the recent circuit structure */ + /* re-load input deck from the recent circuit structure with mc_source */ else if (!ft_curckt && mc_deck) { deck = inp_deckcopy(mc_deck); expr_w_temper = TRUE; } /* no circuit available, should not happen */ else { - fprintf(stderr, "Error: No circuit loaded, cannot copy internally using mc_source\n"); + fprintf(stderr, "Error: No circuit loaded, cannot copy internally using mc_source or reset\n"); controlled_exit(1); } /* print out the re-loaded deck into debug-out-mc.txt */