]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
try to fix coverity 24003, check cast to pointers not being null
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Tue, 10 Jun 2014 19:57:35 +0000 (21:57 +0200)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Tue, 10 Jun 2014 20:31:58 +0000 (22:31 +0200)
EMCAL/AliEMCALUnfolding.cxx

index df27c8fb01cdd22e281ecb90b0a16b847c66acbd..c9d603fd07de7b6f1ef114adaa2e7e6dec4dedd9 100644 (file)
@@ -779,10 +779,16 @@ Bool_t AliEMCALUnfolding::FindFitV2(AliEMCALRecPoint * recPoint, AliEMCALDigit *
   Int_t iphi    =  0 ;//x direction
   Int_t ieta    =  0 ;//z direstion
 
-  for(iDigit = 0; iDigit < nDigits; iDigit++){
+  for(iDigit = 0; iDigit < nDigits; iDigit++)
+  {
     digit = maxAt[iDigit];
-    if(digit==0) AliError("energy of digit = 0!");
-    fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
+    if(!digit)
+    {
+      AliError("Null digit pointer");
+      continue;
+    }
+    
+    fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta);
     fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
                                       iIphi, iIeta,iphi,ieta);