Coverity 17475
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Aug 2011 10:05:39 +0000 (10:05 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Aug 2011 10:05:39 +0000 (10:05 +0000)
MUON/AliMUONAlignmentTask.cxx

index 7c084d5..a154887 100644 (file)
@@ -469,7 +469,9 @@ void AliMUONAlignmentTask::UserExec(Option_t *)
 
     // save AOD
     if( fWriteRecords && fRecordCount > 0 ) { 
-                       AliAODHandler* handler = dynamic_cast<AliAODHandler*>( AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler() );
+      AliAODHandler* handler = dynamic_cast<AliAODHandler*>( AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler() );
+      if( handler )
+       {
 //                     printf("handler: %p\n",handler);
                        AliAODEvent* aod = handler->GetAOD();
 //                     printf("aod: %p\n",aod);
@@ -477,7 +479,9 @@ void AliMUONAlignmentTask::UserExec(Option_t *)
 //                     printf("header: %p\n",header);
                        header->SetRunNumber(lESD->GetRunNumber());
 //                     printf("RunNumber: %d\n",lESD->GetRunNumber());
-                       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE); }
+                       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
+       } else AliInfo( "Error: invalid output event handler" );
+    }
 
   }