[gimp/wip/Jehan/layers-dockable-refresh: 74/92] app: generate a critical with some more information.




commit c19998c0d7e905d6013aa1e8f5ea49496afdc208
Author: Jehan <jehan girinstud io>
Date:   Sun Jun 20 13:22:53 2021 +0200

    app: generate a critical with some more information.
    
    I had a weird case where g_return_val_if_fail() ran but I could not
    reproduce and am not sure how this happened. Adding the item name may
    help diagnose the next time it happens.

 app/widgets/gimpcontainertreeview.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 00315a3651..d111ae28b2 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -923,7 +923,12 @@ gimp_container_tree_view_select_items (GimpContainerView *view,
         {
           GtkTreePath *path;
           path = gimp_container_tree_view_get_path (tree_view, item->data);
-          g_return_val_if_fail (path, FALSE);
+          if (path == NULL)
+            {
+              g_critical ("%s: item %s has no path!\n",
+                          G_STRFUNC, gimp_object_get_name (GIMP_OBJECT (item->data)));
+              return FALSE;
+            }
           paths = g_list_prepend (paths, path);
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]