[gimp/wip/Jehan/layers-dockable-refresh: 50/78] app: generate a critical with some more information.
- From: Jehan <jehanp src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gimp/wip/Jehan/layers-dockable-refresh: 50/78] app: generate a critical with some more information.
 
- Date: Thu, 11 Nov 2021 21:09:10 +0000 (UTC)
 
commit d4d9a23b8659ad3779409762c8f13c0fb61fef89
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]