Skip to content

Commit 1795e2f

Browse files
committed
fix possible deref of nullptr error message
1 parent 3a57811 commit 1795e2f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

PWGCF/GenericFramework/Core/FlowContainer.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
#include "FlowContainer.h"
1313

14+
#include <cstdio>
15+
#include <vector>
16+
1417
ClassImp(FlowContainer);
1518

1619
FlowContainer::FlowContainer() : TNamed("", ""),
@@ -916,8 +919,12 @@ TProfile* FlowContainer::GetRefFlowProfile(const char* order, double m1, double
916919
delete tempprof;
917920
}
918921
delete rhSubset;
919-
retpf->RebinX(nBins);
920-
return retpf;
922+
if (retpf) {
923+
retpf->RebinX(nBins);
924+
return retpf;
925+
} else {
926+
return nullptr;
927+
}
921928
};
922929

923930
//{2} particle correlations

0 commit comments

Comments
 (0)