make sure that singleRunMsrFile is a legal pointer before proceeding.

This commit is contained in:
suter_a 2023-11-01 14:38:21 +01:00
parent b1b808ad7b
commit 4747fbc77d

View File

@ -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) {