[Xfce4-commits] <xfdesktop:master> Avoid calling g_object_ref on NULL

Eric Koegel noreply at xfce.org
Sun Sep 15 07:56:01 CEST 2013


Updating branch refs/heads/master
         to 383b9773c07966d90b4e36d6281bc6f25f2dcab7 (commit)
       from f4d8e496b996094e9ef016817262994e7cf1ae99 (commit)

commit 383b9773c07966d90b4e36d6281bc6f25f2dcab7
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Sep 15 08:53:51 2013 +0300

    Avoid calling g_object_ref on NULL

 src/xfdesktop-file-utils.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c
index 23e5dc3..facc374 100644
--- a/src/xfdesktop-file-utils.c
+++ b/src/xfdesktop-file-utils.c
@@ -377,7 +377,8 @@ xfdesktop_file_utils_file_icon_list_to_file_list(GList *icon_list)
     for(l = icon_list; l; l = l->next) {
         icon = XFDESKTOP_FILE_ICON(l->data);
         file = xfdesktop_file_icon_peek_file(icon);
-        file_list = g_list_prepend(file_list, g_object_ref(file));
+        if(file)
+            file_list = g_list_prepend(file_list, g_object_ref(file));
     }
 
     return g_list_reverse(file_list);


More information about the Xfce4-commits mailing list