Avoid warning spew if error == NULL
authorAlexander Larsson <alexl@redhat.com>
Fri, 7 Dec 2007 11:47:31 +0000 (11:47 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Fri, 7 Dec 2007 11:47:31 +0000 (11:47 +0000)
2007-12-07  Alexander Larsson  <alexl@redhat.com>

* glocalfileenumerator.c (_g_local_file_enumerator_new):
Avoid warning spew if error == NULL

svn path=/trunk/; revision=6065

gio/ChangeLog
gio/glocalfileenumerator.c

index c65865da091483e568759fe4a7f094c1d4d91bbe..fc56e5685379320a7d2d9f389dfb2ad6d3d7c87e 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-07  Alexander Larsson  <alexl@redhat.com>
+
+       * glocalfileenumerator.c (_g_local_file_enumerator_new):
+       Avoid warning spew if error == NULL
+       
 2007-12-07  Alexander Larsson  <alexl@redhat.com>
 
        * gfile.c:
index 1859d41f3bf69ce28dd5b81f20833537c87c7aeb..8d16a86c3aa4b23334f90b73a5bffcaf07dae87a 100644 (file)
@@ -149,8 +149,11 @@ _g_local_file_enumerator_new (const char           *filename,
   dir = g_dir_open (filename, 0, error != NULL ? &dir_error : NULL);
   if (dir == NULL) 
     {
-      convert_file_to_io_error (error, dir_error);
-      g_error_free (dir_error);
+      if (error != NULL)
+       {
+         convert_file_to_io_error (error, dir_error);
+         g_error_free (dir_error);
+       }
       return NULL;
     }