[gimp] app: add g_return_if_fail() to gimp_guide_get_style() and is_custom()



commit 1b6f414d4d9d8c5e9c73e07a51001003ea48b312
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 3 20:31:10 2016 +0200

    app: add g_return_if_fail() to gimp_guide_get_style() and is_custom()

 app/core/gimpguide.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpguide.c b/app/core/gimpguide.c
index 08f7c36..40463b9 100644
--- a/app/core/gimpguide.c
+++ b/app/core/gimpguide.c
@@ -287,15 +287,18 @@ gimp_guide_removed (GimpGuide *guide)
   g_signal_emit (guide, gimp_guide_signals[REMOVED], 0);
 }
 
-
 GimpGuideStyle
 gimp_guide_get_style (GimpGuide *guide)
 {
+  g_return_val_if_fail (GIMP_IS_GUIDE (guide), GIMP_GUIDE_STYLE_NONE);
+
   return guide->priv->style;
 }
 
 gboolean
 gimp_guide_is_custom (GimpGuide *guide)
 {
-  return (guide->priv->style != GIMP_GUIDE_STYLE_NORMAL);
+  g_return_val_if_fail (GIMP_IS_GUIDE (guide), FALSE);
+
+  return guide->priv->style != GIMP_GUIDE_STYLE_NORMAL;
 }


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