check for nullptr in HybridConditional::equals

release/4.3a0
Varun Agrawal 2023-01-03 03:47:55 -05:00
parent f117da2367
commit cb885fb980
1 changed files with 16 additions and 0 deletions

View File

@ -117,6 +117,22 @@ bool HybridConditional::equals(const HybridFactor &other, double tol) const {
return other != nullptr && dc->equals(*other, tol);
}
return inner_->equals(*(e->inner_), tol);
if (inner_) {
if (e->inner_) {
// Both the inner_ factors are not null
return inner_->equals(*(e->inner_), tol);
} else {
return false;
}
} else {
if (e->inner_) {
return false;
} else {
// Both inner_ are null
return true;
}
}
}
/* ************************************************************************ */