Additional protections included
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Sep 2001 16:31:55 +0000 (16:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Sep 2001 16:31:55 +0000 (16:31 +0000)
TOF/AliTOFDigitizer.cxx

index b2a0c8ef7a7a185a962659787f57ef4281f7709b..38ad4437eb72cd5eadd0eb0363ff68b9066366b6 100644 (file)
@@ -127,10 +127,17 @@ void AliTOFDigitizer::Init()
     fDigits  = new TClonesArray("AliTOFdigit", 405);
     
     //add Task to //FPAlice/tasks/(S)Digitizer/TOF
-    TFolder * alice  = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("FPAlice") ;
-    TTask * aliceSD  = (TTask*)alice->FindObject("tasks/(S)Digitizer") ;
-    TTask * tofD   = (TTask*)aliceSD->GetListOfTasks()->FindObject("TOF") ;
-    tofD->Add(this) ;
+    TList * aList = gROOT->GetListOfBrowsables();
+    if (aList) {
+      TFolder * alice  = (TFolder*)aList->FindObject("FPAlice") ;
+      if (alice) {
+        TTask * aliceSD  = (TTask*)alice->FindObject("tasks/(S)Digitizer") ;
+        if (aliceSD) {
+          TTask * tofD   = (TTask*)aliceSD->GetListOfTasks()->FindObject("TOF") ;   
+          tofD->Add(this) ;
+        }
+      }
+    }
 
     fIsInitialized = kTRUE ;
   }