From 588533751b07d69a1940241ba6a144eb30ae4938 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 10 Dec 2024 14:10:33 -0500 Subject: [PATCH] add another pointer check --- gtsam/discrete/DiscreteFactorGraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index ec6dac2fc..d0bf21047 100644 --- a/gtsam/discrete/DiscreteFactorGraph.cpp +++ b/gtsam/discrete/DiscreteFactorGraph.cpp @@ -76,7 +76,7 @@ namespace gtsam { double DiscreteFactorGraph::operator()(const DiscreteValues& values) const { double product = 1.0; for (const sharedFactor& factor : factors_) { - product *= (*factor)(values); + if (factor) product *= (*factor)(values); } return product; }