Trap if conditional==null.

release/4.3a0
Frank Dellaert 2023-01-16 18:56:40 -08:00
parent 519b2bb515
commit 32d69a3bd7
1 changed files with 4 additions and 2 deletions

View File

@ -41,8 +41,10 @@ GaussianMixture::GaussianMixture(
logConstant_ = -std::numeric_limits<double>::infinity();
conditionals_.visit(
[this](const GaussianConditional::shared_ptr &conditional) {
this->logConstant_ = std::max(this->logConstant_,
conditional->logNormalizationConstant());
if (conditional) {
this->logConstant_ = std::max(
this->logConstant_, conditional->logNormalizationConstant());
}
});
}