Fix crash in update_cursor_demo().
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 12 Sep 2014 22:56:21 +0000 (01:56 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 12 Sep 2014 22:56:21 +0000 (01:56 +0300)
src/cursor-theme.c

index 4e77d68..ce14c75 100644 (file)
@@ -44,8 +44,11 @@ static void update_cursor_demo()
         cursor = gdk_cursor_new(types[i]);
         GdkPixbuf* pix = gdk_cursor_get_image(cursor);
         gdk_cursor_unref(cursor);
-        gtk_list_store_insert_with_values(store, &it, -1, 0, pix, -1);
-        g_object_unref(pix);
+        if (pix != NULL)
+        {
+            gtk_list_store_insert_with_values(store, &it, -1, 0, pix, -1);
+            g_object_unref(pix);
+        }
     }
     gtk_icon_view_set_model(GTK_ICON_VIEW(app.cursor_demo_view), GTK_TREE_MODEL(store));
     g_object_unref(store);