[gegl] operation: Use softer assertions at the public API boundary
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operation: Use softer assertions at the public API boundary
- Date: Mon, 13 Nov 2017 14:20:11 +0000 (UTC)
commit ceba8e415f10cff64ed35457a5b4fd19b81682a2
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]