From 4747fbc77da11d7a836e9b2abb7e3589dc6d31fb Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 1 Nov 2023 14:38:21 +0100 Subject: [PATCH] make sure that singleRunMsrFile is a legal pointer before proceeding. --- src/classes/PMsr2Data.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/classes/PMsr2Data.cpp b/src/classes/PMsr2Data.cpp index edb99b74..acb64f7f 100644 --- a/src/classes/PMsr2Data.cpp +++ b/src/classes/PMsr2Data.cpp @@ -1302,8 +1302,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string & if (newRunNumber.str().compare(tempRunNumber.str())) { // first run number does not match the template run number // in global+ mode, read in the single run msr-file of the corresponding run - if (globalPlus) + if (globalPlus) { singleRunMsrFile = GetSingleRunMsrFile(); + if (singleRunMsrFile == nullptr) + return false; + } // substitute the template run-numbers in the parameter names for (unsigned int l(fNumGlobalParam); l < msrParamList->size(); ++l) { @@ -1380,8 +1383,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string & newRunNumber << *fRunVectorIter; // in global+ mode, read in the single run msr-file - if (globalPlus) + if (globalPlus) { singleRunMsrFile = GetSingleRunMsrFile(); + if (singleRunMsrFile == nullptr) + return false; + } // add parameters for each run for (unsigned int l(0); l < fNumSpecParam; ++l) {