changeset 12458:8626cc8d0df9

[gaim-migrate @ 14767] Don't allow adding a group with an empty name. We should probably not allow this in the GUI, too. This is better than nothing, though. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 12 Dec 2005 05:58:56 +0000
parents e585695bc16b
children 5f8cfa774141
files src/blist.c src/gtkblist.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Mon Dec 12 05:48:08 2005 +0000
+++ b/src/blist.c	Mon Dec 12 05:58:56 2005 +0000
@@ -1457,8 +1457,12 @@
 GaimGroup *gaim_group_new(const char *name)
 {
 	GaimBlistUiOps *ops = gaim_blist_get_ui_ops();
-	GaimGroup *group = gaim_find_group(name);
-
+	GaimGroup *group;
+
+	g_return_val_if_fail(name  != NULL, NULL);
+	g_return_val_if_fail(*name != '\0', NULL);
+
+	group = gaim_find_group(name);
 	if (group != NULL)
 		return group;
 
--- a/src/gtkblist.c	Mon Dec 12 05:48:08 2005 +0000
+++ b/src/gtkblist.c	Mon Dec 12 05:58:56 2005 +0000
@@ -4811,6 +4811,9 @@
 {
 	GaimGroup *group;
 
+	if ((group_name == NULL) || (*group_name == '\0'))
+		return;
+
 	group = gaim_group_new(group_name);
 	gaim_blist_add_group(group, NULL);
 }