Skip to content

Commit cb2381f

Browse files
committed
[QC-984] Fix pp finalize no init (#1834)
* [QC-984] nullptr if finalize is called before initialize * format * do not finalize if it is not initialized. * actually fix * format
1 parent 9e57052 commit cb2381f

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

Framework/src/PostProcessingRunner.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ void PostProcessingRunner::doUpdate(const Trigger& trigger)
237237

238238
void PostProcessingRunner::doFinalize(const Trigger& trigger)
239239
{
240+
if (mTaskState != TaskState::Running) {
241+
ILOG(Warning, Support) << "Attempt at finalizing the user task although it was not initialized. Skipping the finalization." << ENDM;
242+
return;
243+
}
240244
ILOG(Info, Support) << "Finalizing the user task due to trigger '" << trigger << "'" << ENDM;
241245
mTask->finalize(trigger, mServices);
242246
mObjectManager->setValidity(ValidityInterval{ trigger.timestamp, trigger.timestamp + objectValidity });

Framework/src/SliceTrendingTask.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ void SliceTrendingTask::trendValues(const Trigger& t,
151151

152152
void SliceTrendingTask::generatePlots()
153153
{
154+
if (mTrend == nullptr) {
155+
ILOG(Info, Support) << "The trend object is not there, won't generate any plots." << ENDM;
156+
return;
157+
}
158+
154159
if (mTrend->GetEntries() < 1) {
155160
ILOG(Info, Support) << "No entries in the trend so far, no plot generated." << ENDM;
156161
return;

Framework/src/TrendingTask.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ void TrendingTask::setUserYAxisRange(TH1* hist, const std::string& graphYAxisRan
199199

200200
void TrendingTask::generatePlots()
201201
{
202+
if (mTrend == nullptr) {
203+
ILOG(Info, Support) << "The trend object is not there, won't generate any plots." << ENDM;
204+
return;
205+
}
206+
202207
if (mTrend->GetEntries() < 1) {
203208
ILOG(Info, Support) << "No entries in the trend so far, won't generate any plots." << ENDM;
204209
return;

0 commit comments

Comments
 (0)