Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1652)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1653)
@@ -1,3 +1,9 @@
                                                                   -*-*- END -*-*-
+ 2002/11/20: Abelardo Moralejo
+
+   * macros/collarea.C:
+     - Introduced check before opening output file to avoid annoying 
+       error message.
+
  2002/11/19: Abelardo Moralejo
 
@@ -18,5 +24,4 @@
      - removed also the corresponding AddToList for the tasklist
 
-
  2002/11/19: Abelardo Moralejo
 
@@ -24,5 +29,4 @@
      - Added 2nd argument to write an output file containing the 
        collection area histogram.
-
 
 
Index: /trunk/MagicSoft/Mars/macros/collarea.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/collarea.C	(revision 1652)
+++ /trunk/MagicSoft/Mars/macros/collarea.C	(revision 1653)
@@ -70,10 +70,13 @@
     // Write histogram to a file in case an output filename has been supplied:
 
-    TFile* f = new TFile(outname,"recreate");
-    if (f)
+    if (strlen(outname) > 0)
       {
-	TH1D* hc = ((MHMcCollectionArea*)parlist.FindObject("MHMcCollectionArea"))->GetHist();
-	hc->Write();
-	f.Close();
+	TFile* f = new TFile(outname,"recreate");
+	if (f)
+	  {
+	    TH1D* hc = ((MHMcCollectionArea*)parlist.FindObject("MHMcCollectionArea"))->GetHist();
+	    hc->Write();
+	    f.Close();
+	  }
       }
 }
