Prevent a crash if port cntrl is set to NULL
This commit is contained in:
parent
01bdd44ef9
commit
dbc5042263
|
|
@ -298,13 +298,17 @@ void cm_delay(ARGS)
|
|||
delmin = loc->tdelmin;
|
||||
delmax = loc->tdelmax;
|
||||
|
||||
lcntrl = INPUT(cntrl);
|
||||
if (lcntrl < 0)
|
||||
lcntrl = 0.;
|
||||
else if (lcntrl > 1.)
|
||||
lcntrl = 1.;
|
||||
|
||||
if (PARAM(has_delay_cnt) == MIF_TRUE) {
|
||||
if (!PORT_NULL(cntrl)) {
|
||||
lcntrl = INPUT(cntrl);
|
||||
if (lcntrl < 0)
|
||||
lcntrl = 0.;
|
||||
else if (lcntrl > 1.)
|
||||
lcntrl = 1.;
|
||||
}
|
||||
else {
|
||||
lcntrl = 0;
|
||||
}
|
||||
delay = (delmax - delmin) * lcntrl + delmin;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue