Skip to content

Commit 1ae089b

Browse files
committed
Added check on pointer returned from GetRefFlowProfile
1 parent 0537b2c commit 1ae089b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

PWGCF/GenericFramework/Core/FlowContainer.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,11 @@ TH1D* FlowContainer::GetHistCorrXXVsPt(const char* order, double lminmulti, doub
465465
TProfile* tpf = GetCorrXXVsPt(order, lminmulti, lmaxmulti);
466466
TH1D* rethist = ProfToHist(tpf);
467467
TProfile* refflow = GetRefFlowProfile(order, lminmulti, lmaxmulti);
468-
refflow->RebinX(refflow->GetNbinsX());
469-
rethist->SetBinContent(0, refflow->GetBinContent(1));
470-
rethist->SetBinError(0, refflow->GetBinError(1));
468+
if (refflow) {
469+
refflow->RebinX(refflow->GetNbinsX());
470+
rethist->SetBinContent(0, refflow->GetBinContent(1));
471+
rethist->SetBinError(0, refflow->GetBinError(1));
472+
}
471473
delete refflow;
472474
delete tpf;
473475
return rethist;
@@ -922,8 +924,9 @@ TProfile* FlowContainer::GetRefFlowProfile(const char* order, double m1, double
922924
if (!retpf) {
923925
LOGF(error, "Reference flow profile is null");
924926
return nullptr;
927+
} else {
928+
retpf->RebinX(nBins);
925929
}
926-
retpf->RebinX(nBins);
927930
return retpf;
928931
};
929932

0 commit comments

Comments
 (0)