add another pointer check
parent
2fd60a47a2
commit
588533751b
|
@ -76,7 +76,7 @@ namespace gtsam {
|
||||||
double DiscreteFactorGraph::operator()(const DiscreteValues& values) const {
|
double DiscreteFactorGraph::operator()(const DiscreteValues& values) const {
|
||||||
double product = 1.0;
|
double product = 1.0;
|
||||||
for (const sharedFactor& factor : factors_) {
|
for (const sharedFactor& factor : factors_) {
|
||||||
product *= (*factor)(values);
|
if (factor) product *= (*factor)(values);
|
||||||
}
|
}
|
||||||
return product;
|
return product;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue