prevent crash if 0 length vector is assessed

This commit is contained in:
Holger Vogt 2019-11-27 23:31:22 +01:00
parent 78c4a51d2a
commit 9a77d22444
1 changed files with 4 additions and 1 deletions

View File

@ -92,7 +92,10 @@ VSRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *
strcpy(errMsg,msg);
return(E_ASKCURRENT);
} else {
value->rValue = *(ckt->CKTrhsOld+here->VSRCbranch);
if (ckt->CKTrhsOld)
value->rValue = *(ckt->CKTrhsOld + here->VSRCbranch);
else
value->rValue = 0.;
}
return(OK);
case VSRC_POWER: