fix coverity
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Oct 2011 09:09:22 +0000 (09:09 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Oct 2011 09:09:22 +0000 (09:09 +0000)
PWG1/TRD/AliTRDresolution.cxx

index 8c58b7c..1585176 100644 (file)
@@ -2275,7 +2275,8 @@ TH2* AliTRDresolution::AliTRDresolutionProjection::Projection2D(const Int_t nsta
   const Char_t *title[] = {"Mean", "#mu", "MPV"};
   if(!fH) return NULL;
   TAxis *ax(fH->GetXaxis()), *ay(fH->GetYaxis()), *az(fH->GetZaxis());
-  TH2 *h2s = (TH2*)fH->Project3D("yx");
+  TH2 *h2s(NULL);
+  if(!(h2s = (TH2*)fH->Project3D("yx"))) return NULL;
   Int_t irebin(0), dxBin(1), dyBin(1);
   while(irebin<fNrebin && (AliTRDresolution::GetMeanStat(h2s, .5, ">")<nstat)){
     h2s->Rebin2D(fRebinX[irebin], fRebinY[irebin]);