Additional protection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 May 2012 12:21:18 +0000 (12:21 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 May 2012 12:21:18 +0000 (12:21 +0000)
EMCAL/AliEMCALTriggerElectronics.cxx

index 4c67bf0..860ca74 100644 (file)
@@ -138,10 +138,13 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_
                        if (isOK1 && isOK2 && amp) {
                                AliDebug(999, Form("=== TRU# %2d ADC# %2d time# %2d signal %d ===", iTRU, iADC, time, amp));
                                
-                               if (data->GetMode())
-                                       (static_cast<AliEMCALTriggerTRU*>(fTRU->At(iTRU)))->SetADC(iADC, time, 4 * amp);
-                               else
-                                       (static_cast<AliEMCALTriggerTRU*>(fTRU->At(iTRU)))->SetADC(iADC, time,     amp);
+                               AliEMCALTriggerTRU * etr = (static_cast<AliEMCALTriggerTRU*>(fTRU->At(iTRU)));
+                               if (etr) {
+                                 if (data->GetMode())
+                                   etr->SetADC(iADC, time, 4 * amp);
+                                 else
+                                   etr->SetADC(iADC, time,     amp);
+                               }
                        }
                }