From 10325a5d48ac226cb75cace350094f760710a33e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 20 Mar 2003 20:25:22 +0000 Subject: Make sure we can find the registered handler before trying to remove it 2003-03-20 Jeffrey Stedfast * mail-config.c (mail_config_signature_unregister_client): Make sure we can find the registered handler before trying to remove it from the list. svn path=/trunk/; revision=20443 --- mail/mail-config.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index f65eee55da..cfd550e716 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1341,6 +1341,8 @@ mail_config_signature_set_name (MailConfigSignature *sig, const char *name) static GList *clients = NULL; +/* uh...the following code is snot. this needs to be fixed. I just don't feel like doing it right now. */ + void mail_config_signature_register_client (MailConfigSignatureClient client, gpointer data) { @@ -1352,10 +1354,11 @@ void mail_config_signature_unregister_client (MailConfigSignatureClient client, gpointer data) { GList *link; - - link = g_list_find (clients, data); - clients = g_list_remove_link (clients, link->prev); - clients = g_list_remove_link (clients, link); + + if ((link = g_list_find (clients, data)) != NULL) { + clients = g_list_remove_link (clients, link->prev); + clients = g_list_remove_link (clients, link); + } } void -- cgit