Protection in case there is no output handler.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jun 2008 07:26:49 +0000 (07:26 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jun 2008 07:26:49 +0000 (07:26 +0000)
ANALYSIS/AliAnalysisTaskSE.cxx

index c5285f2..b3152f0 100644 (file)
@@ -177,19 +177,21 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
 
     AliAODHandler* handler = (AliAODHandler*) 
        ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
-
-    if (!(handler->IsStandard())            && 
-       (handler->NeedsHeaderReplication()) &&
-       (fgAODHeader))
-    {
-       // Header should be replicated
-       AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
-       if (aodH) {
-           // Input is AOD
-           fgAODHeader =  dynamic_cast<AliAODHeader*>(InputEvent()->GetHeader());
-           fgHeaderCopied = kTRUE;
+    if (handler) {
+       if (!(handler->IsStandard())            && 
+           (handler->NeedsHeaderReplication()) &&
+           (fgAODHeader))
+       {
+           // Header should be replicated
+           AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
+           if (aodH) {
+               // Input is AOD
+               fgAODHeader =  dynamic_cast<AliAODHeader*>(InputEvent()->GetHeader());
+               fgHeaderCopied = kTRUE;
+           }
        }
     }
+    
 
 // Call the user analysis    
     UserExec(option);