]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity (Francesco)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 22:11:54 +0000 (22:11 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 22:11:54 +0000 (22:11 +0000)
PWG1/ITS/AliAnalysisTaskITSAlignQA.cxx

index 5e1b18c28b04d5af8ab3af4289cc8ee736bb2f38..49c4f20cfcdefcbc7b1bf95306201969525411c9 100644 (file)
@@ -542,7 +542,11 @@ void AliAnalysisTaskITSAlignQA::Terminate(Option_t */*option*/)
   }
 
   fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("hNEvents"));
-  printf("Number of analyzed events = %d\n",(Int_t)fHistNEvents->GetBinContent(2));
+  if(fHistNEvents){
+    printf("Number of analyzed events = %d\n",(Int_t)(fHistNEvents->GetBinContent(2)));
+  }else{
+    printf("Warning: pointer to fHistNEvents is NULL\n");
+  }
   return;
 }
 
@@ -558,9 +562,12 @@ void AliAnalysisTaskITSAlignQA::LoadGeometryFromOCDB(){
   man->SetDefaultStorage(fOCDBLocation.Data());
   man->SetRun(fRunNb);
   AliCDBEntry* obj = man->Get(AliCDBPath("GRP", "Geometry", "Data"));
-  AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
-  AliGeomManager::GetNalignable("ITS");
-  AliGeomManager::ApplyAlignObjsFromCDB("ITS");
+  if(obj){
+    AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
+    AliGeomManager::GetNalignable("ITS");
+    AliGeomManager::ApplyAlignObjsFromCDB("ITS");
+  }
+  else AliFatal("Geometry object not found in OCDB");
 }