]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity fix: unchecked dynamic_cast
authorpolicheh <Boris.Polishchuk@cern.ch>
Sun, 11 Jan 2015 19:09:26 +0000 (22:09 +0300)
committerpolicheh <Boris.Polishchuk@cern.ch>
Sun, 11 Jan 2015 19:09:26 +0000 (22:09 +0300)
PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0FlowMCParamWeights.cxx

index 969bb9ba281ed631ac8efd4e1b920662fd21e3de..f428993293159f128dff042ec6c57994479581d1 100644 (file)
@@ -49,11 +49,11 @@ void AliAnalysisTaskPi0FlowMCParamWeights::UserCreateOutputObjects()
 
       sprintf(key,"hPi0%s_cen%d", pidNames[ipid],iBin);  
       hist = dynamic_cast<TH1*>(fOutputContainer->FindObject(key));
 
       sprintf(key,"hPi0%s_cen%d", pidNames[ipid],iBin);  
       hist = dynamic_cast<TH1*>(fOutputContainer->FindObject(key));
-      hist->Sumw2(); printf("     ->Sumw2 invoked for %s.\n",key);
+      if(hist) { hist->Sumw2(); printf("     ->Sumw2 invoked for %s.\n",key); }
 
       sprintf(key,"hMiPi0%s_cen%d", pidNames[ipid],iBin);  
       hist = dynamic_cast<TH1*>(fOutputContainer->FindObject(key));
 
       sprintf(key,"hMiPi0%s_cen%d", pidNames[ipid],iBin);  
       hist = dynamic_cast<TH1*>(fOutputContainer->FindObject(key));
-      hist->Sumw2(); printf("     ->Sumw2 invoked for %s.\n",key);
+      if(hist) { hist->Sumw2(); printf("     ->Sumw2 invoked for %s.\n",key); }
     }
   }
   
     }
   }