From e88bfb714528303b48cbb0c24a9e49cb013e83f1 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 8 Jul 2024 14:45:23 +0200 Subject: [PATCH] - issue 3249: only request constraint objects if they exist --- copasi/parameterFitting/CFitProblem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/copasi/parameterFitting/CFitProblem.cpp b/copasi/parameterFitting/CFitProblem.cpp index 487ad8970c..4742e76d60 100644 --- a/copasi/parameterFitting/CFitProblem.cpp +++ b/copasi/parameterFitting/CFitProblem.cpp @@ -710,7 +710,8 @@ bool CFitProblem::initialize() for (i = 0, imax = mpExperimentSet->getExperimentCount(); i < imax; i++) { mExperimentConstraints(i, j) = pConstraint; - ObjectSet[i].insert(pConstraint->getObject()); + if (pConstraint->getObject()) + ObjectSet[i].insert(pConstraint->getObject()); } } else @@ -721,7 +722,8 @@ bool CFitProblem::initialize() return false; mExperimentConstraints(Index, j) = pConstraint; - ObjectSet[Index].insert(pConstraint->getObject()); + if (pConstraint->getObject()) + ObjectSet[Index].insert(pConstraint->getObject()); }; } }