[Rawstudio-commit] r2070 - trunk/src

Anders Brander anders at brander.dk
Mon Oct 13 22:27:11 CEST 2008


Author: abrander
Date: 2008-10-13 22:27:11 +0200 (Mon, 13 Oct 2008)
New Revision: 2070

Modified:
   trunk/src/rs-store.c
Log:
Deal with dir==NULL in load_directory().

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c	2008-10-13 20:21:52 UTC (rev 2069)
+++ trunk/src/rs-store.c	2008-10-13 20:27:11 UTC (rev 2070)
@@ -990,7 +990,7 @@
 
 	dir = g_dir_open(path, 0, NULL); /* FIXME: check errors */
 
-	while((name = g_dir_read_name(dir)))
+	while((dir != NULL) && (name = g_dir_read_name(dir)))
 	{
 		/* Ignore "hidden" files and directories */
 		if (name[0] == '.')
@@ -1040,8 +1040,10 @@
 	}
 
 	g_object_unref(pixbuf);
-	g_dir_close(dir);
 
+	if (dir)
+		g_dir_close(dir);
+
 	return count;
 }
 




More information about the Rawstudio-commit mailing list