From 713009771027d0d2c494d74e83063a19023ef8b2 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 19 Feb 2022 17:23:36 +0100 Subject: [PATCH] Prevent crash when no simulation has been run and asking for plotting an event node --- src/xspice/evt/evtplot.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xspice/evt/evtplot.c b/src/xspice/evt/evtplot.c index 33cb232e9..7b1106f5f 100644 --- a/src/xspice/evt/evtplot.c +++ b/src/xspice/evt/evtplot.c @@ -152,6 +152,12 @@ struct dvec *EVTfindvec( /* Get the UDN type index */ udn_index = node_table[i]->udn_index; + if (!g_mif_info.ckt->evt->data.node) { +// fprintf(stderr, "Warning: No event data available! \n Simulation not yet run?\n"); + tfree(name); + return(NULL); + } + /* Count the number of events */ head = g_mif_info.ckt->evt->data.node->head[i];