Coverity Fix 16220
[u/mrichter/AliRoot.git] / ANALYSIS / EventMixing / AliMixInputEventHandler.cxx
index a006027788560fe9c17839c70781ff5327d5620c..fd9bab82f30476227be7354ee1beac821102afb6 100644 (file)
@@ -38,7 +38,8 @@ AliMixInputEventHandler::AliMixInputEventHandler(const Int_t size, const Int_t m
    fCurrentEntry(0),
    fCurrentEntryMain(0),
    fCurrentEntryMix(0),
-   fCurrentBinIndex(-1)
+   fCurrentBinIndex(-1),
+   fOfflineTriggerMask(0)
 {
    //
    // Default constructor.
@@ -524,8 +525,10 @@ Bool_t AliMixInputEventHandler::IsEventCurrentSelected()
    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    AliMultiInputEventHandler *mh = dynamic_cast<AliMultiInputEventHandler *>(mgr->GetInputEventHandler());
    Bool_t isSelected = kTRUE;
-   if (fOfflineTriggerMask && mh->GetEventSelection()) {
-      isSelected = fOfflineTriggerMask & mh->IsEventSelected();
+   if (mh) {
+      if (fOfflineTriggerMask && mh->GetEventSelection()) {
+         isSelected = fOfflineTriggerMask & mh->IsEventSelected();
+      }
    }
    AliDebug(AliLog::kDebug + 1, Form("isSelected=%d", isSelected));
    AliDebug(AliLog::kDebug + 5, Form("-> %d", isSelected));