[gegl/wip/rishi/operation-shadhi: 1/4] operation: Use softer assertions at the public API boundary



commit cfca7e37bd4e3efc9441ec07e66308756fe0308d
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 10 09:36:47 2017 +0100

    operation: Use softer assertions at the public API boundary
    
    It doesn't hurt to be more forgiving, and is what most GLib/GObject
    based APIs do.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790111

 gegl/operation/gegl-operation.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index 05b4c82..c95242c 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -351,9 +351,10 @@ gegl_operation_get_source_node (GeglOperation *operation,
 {
   GeglPad *pad;
 
-  g_assert (operation &&
-            operation->node &&
-            input_pad_name);
+  g_return_val_if_fail (GEGL_IS_OPERATION (operation), NULL);
+  g_return_val_if_fail (GEGL_IS_NODE (operation->node), NULL);
+  g_return_val_if_fail (input_pad_name != NULL, NULL);
+
   pad = gegl_node_get_pad (operation->node, input_pad_name);
 
   if (!pad)


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