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



commit 51fed7c8451e50c3e3d8800c507254536be85d91
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);
    
    (cherry picked from commit ec4dbbcbc21e1233e46ba9ae059a18bed459ca24)

 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 838173b..ccbe8f9 100644
--- a/lib/group.c
+++ b/lib/group.c
@@ -314,6 +314,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 7da0c05..b0f5f58 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -2687,7 +2687,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]