Really handle the NULLs, don't scream at them
authorRicardo Mones <ricardo@mones.org>
Mon, 24 Jul 2017 07:35:05 +0000 (09:35 +0200)
committerRicardo Mones <ricardo@mones.org>
Mon, 24 Jul 2017 07:35:05 +0000 (09:35 +0200)
src/prefs_themes.c
src/stock_pixmap.c

index 7472c53..820dff3 100644 (file)
@@ -420,7 +420,9 @@ static void prefs_themes_free_names(ThemesData *tdata)
        GList *names;
 
        cm_return_if_fail(tdata != NULL);
-       cm_return_if_fail(tdata->names != NULL);
+
+       if (tdata->names == NULL)
+               return;
 
        names = tdata->names;
        while (names != NULL) {
index 807d862..593b502 100644 (file)
@@ -840,7 +840,8 @@ void stock_pixmap_themes_list_free(GList *list)
 {
        GList *ptr;
 
-       cm_return_if_fail(list != NULL);
+       if (list == NULL)
+               return;
 
        for (ptr = g_list_first(list); ptr != NULL; ptr = g_list_next(ptr))
                g_free(ptr->data);