[gimp] app: allow passing NULL pointers to gimp_tool_polygon_get_points()



commit e8c915af939ce8ac5697975b99f7d2e74faf4a6d
Author: Ell <ell_se yahoo com>
Date:   Thu Apr 25 04:24:07 2019 -0400

    app: allow passing NULL pointers to gimp_tool_polygon_get_points()

 app/display/gimptoolpolygon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimptoolpolygon.c b/app/display/gimptoolpolygon.c
index e85c1b9a03..0be68e866e 100644
--- a/app/display/gimptoolpolygon.c
+++ b/app/display/gimptoolpolygon.c
@@ -1437,10 +1437,12 @@ gimp_tool_polygon_get_points (GimpToolPolygon    *polygon,
                               const GimpVector2 **points,
                               gint               *n_points)
 {
-  GimpToolPolygonPrivate *private = polygon->private;
+  GimpToolPolygonPrivate *private;
+
+  g_return_if_fail (GIMP_IS_TOOL_POLYGON (polygon));
 
-  g_return_if_fail (points != NULL && n_points != NULL);
+  private = polygon->private;
 
-  *points   = private->points;
-  *n_points = private->n_points;
+  if (points)   *points   = private->points;
+  if (n_points) *n_points = private->n_points;
 }


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