From fec9cf6c473837cd1eeb961d329e7d1d8e18a5f6 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 24 Jul 2015 22:29:35 -0400
Subject: [PATCH] fix regression drawing data structure polyline/polygon when
 points is 0

---
 pd/src/g_template.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pd/src/g_template.c b/pd/src/g_template.c
index 778991e62..9146fcc22 100644
--- a/pd/src/g_template.c
+++ b/pd/src/g_template.c
@@ -3514,10 +3514,13 @@ static void svg_togui(t_svg *x, t_template *template, t_word *data)
     {
         int i, n = x->x_nargs;
         gui_s("points");
-        gui_start_array();
-        for (i = 0; i < x->x_nargs; i++)
-            gui_f(fielddesc_getcoord(&x->x_vec[i], template, data, 1));
-        gui_end_array();
+        if (x->x_nargs)
+        {
+            gui_start_array();
+            for (i = 0; i < x->x_nargs; i++)
+                gui_f(fielddesc_getcoord(&x->x_vec[i], template, data, 1));
+            gui_end_array();
+        }
     }
     if (x->x_strokeopacity.a_flag)
     {
-- 
GitLab