Protection added.
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskSE.cxx
index 89ba7e094dd5806a661e10f015ba4b23d1a6111c..2b07512dc227d29c40d77e178c06641ab44b1d78 100644 (file)
@@ -142,8 +142,12 @@ void AliAnalysisTaskSE::CreateOutputObjects()
     AliAODHandler* handler = (AliAODHandler*) 
          ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
     
-    fOutputAOD   = handler->GetAOD();
-    fTreeA = handler->GetTree();
+    if (handler) {
+       fOutputAOD   = handler->GetAOD();
+       fTreeA = handler->GetTree();
+    } else {
+       AliWarning("No AOD Event Handler connected.") ; 
+    }
     UserCreateOutputObjects();
 }