fix a potential crash if a ngspice_probe.sym device is placed and live cursor annotation is enabled (this instance has no lab attribute)

This commit is contained in:
stefan schippers 2023-06-11 07:24:00 +02:00
parent 2b0655e3e9
commit fc897c641b
1 changed files with 3 additions and 1 deletions

View File

@ -3421,7 +3421,9 @@ const char *translate(int inst, const char* s)
++path;
}
prepare_netlist_structs(0);
my_strdup2(_ALLOC_ID_, &net, expandlabel(xctx->inst[inst].lab, &multip));
if(xctx->inst[inst].lab) {
my_strdup2(_ALLOC_ID_, &net, expandlabel(xctx->inst[inst].lab, &multip));
}
if(net == NULL || net[0] == '\0') {
my_strdup2(_ALLOC_ID_, &net, net_name(inst, 0, &multip, 0, 0));
}