Index: trunk/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/Mars/mfileio/MWriteRootFile.cc	(revision 14025)
+++ trunk/Mars/mfileio/MWriteRootFile.cc	(revision 14029)
@@ -690,4 +690,10 @@
 Bool_t MWriteRootFile::CheckAndWrite()
 {
+    // This is the special case if we only copy a tre but do not
+    // write containers to it
+    const Int_t n = fTrees.GetEntriesFast();
+    if (n==0)
+        return kTRUE;
+
     TObject *obj;
 
@@ -725,6 +731,4 @@
     // Loop over all tree entries
     //
-    const Int_t n = fTrees.GetEntriesFast();
-
     for (int idx=0; idx<n; idx++)
     {
