# HG changeset patch # User Christian Hammond # Date 1081915394 0 # Node ID 4a1e87c50d6fbf35cd051fdbf02007fff04d2680 # Parent a47f038ecf9a48f5c2f8d617dd3a6d0f3b0a2784 [gaim-migrate @ 9409] Patch by shx to make the e-mail notification code in MSN a bit more cautious, and hopefully prevent some of the crashes that people have experienced. committer: Tailor Script diff -r a47f038ecf9a -r 4a1e87c50d6f src/protocols/msn/notification.c --- a/src/protocols/msn/notification.c Wed Apr 14 03:13:08 2004 +0000 +++ b/src/protocols/msn/notification.c Wed Apr 14 04:03:14 2004 +0000 @@ -1705,7 +1705,9 @@ MsnSession *session = servconn->session; GaimConnection *gc = session->account->gc; GHashTable *table; - char *from, *subject; + char *from, *subject, *tmp; + + from = subject = NULL; if (strcmp(msg->passport, "Hotmail")) { /* This isn't an official message. */ @@ -1725,14 +1727,23 @@ table = msn_message_get_hashtable_from_body(msg); - from = gaim_mime_decode_field(g_hash_table_lookup(table, "From")); - subject = gaim_mime_decode_field(g_hash_table_lookup(table, "Subject")); + tmp = g_hash_table_lookup(table, "From"); + if (tmp != NULL) + from = gaim_mime_decode_field(tmp); + + tmp = g_hash_table_lookup(table, "Subject"); + if (tmp != NULL) + subject = gaim_mime_decode_field(tmp); - gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user), - session->passport_info.file, NULL, NULL); + if (from != NULL && subject != NULL) + gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user), + session->passport_info.file, NULL, NULL); - g_free(from); - g_free(subject); + if (from != NULL) + g_free(from); + + if (subject != NULL) + g_free(subject); g_hash_table_destroy(table);