[dia] Bug 735303 - Don't create empty groups from VDX



commit ec4dbbcbc21e1233e46ba9ae059a18bed459ca24
Author: Hans Breuer <hans breuer org>
Date:   Sun Aug 24 13:03:00 2014 +0200

    Bug 735303 - Don't create empty groups from VDX
    
    Fixed in the VDX plug-in itself but also on the lib API level
    with g_return_val_if_fail (objects != NULL, NULL);

 lib/group.c               |    3 +++
 plug-ins/vdx/vdx-import.c |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/lib/group.c b/lib/group.c
index 08ff7f8..1f59600 100644
--- a/lib/group.c
+++ b/lib/group.c
@@ -528,6 +528,9 @@ group_create(GList *objects)
   GList *list;
   int num_conn;
 
+  /* it's a programmer's error to create a group of nothing */
+  g_return_val_if_fail (objects != NULL, NULL);
+
   group = g_new0(Group,1);
   obj = &group->object;
 
diff --git a/plug-ins/vdx/vdx-import.c b/plug-ins/vdx/vdx-import.c
index 8690f71..145c806 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -2547,7 +2547,8 @@ vdx_plot_shape(struct vdx_Shape *Shape, GSList *objects,
             if (child->data) group = g_list_append(group, child->data);
         }
 
-        objects = g_slist_append(objects, create_standard_group(group));
+        if (group) /* the above might leave us empty - ignore it: bug 735303 */
+            objects = g_slist_append(objects, create_standard_group(group));
         /* g_list_free(group); */
         g_slist_free(members);
     }


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