Do not replace the tree if it exists and is empty
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Apr 2007 09:45:33 +0000 (09:45 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Apr 2007 09:45:33 +0000 (09:45 +0000)
STEER/TTreeStream.cxx

index 445f1fb..2287454 100644 (file)
@@ -400,8 +400,8 @@ void TTreeStream::BuildTree(){
   //
   // Build the Tree
   //
-  if (fTree->GetEntries()>0) return;
-  fTree = new TTree(GetName(),GetName());
+  if (fTree && fTree->GetEntries()>0) return;
+  if (!fTree)  fTree = new TTree(GetName(),GetName());
   Int_t entries = fElements->GetEntriesFast();  
   fBranches = new TObjArray(entries);