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




commit b1bb927502af173ab9e4e322983c86fcebd4f812
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 e883570e80..d4f824787c 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -885,7 +885,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]