Mercurial > pidgin
changeset 19382:7e70c8ba6bf4
Fix #2726. (Segafault on click of unknow button.) It was a bug in the musicmessaging plugin.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Thu, 23 Aug 2007 20:54:30 +0000 |
parents | 8d9913d9fe5a |
children | 31d1143ac9ed |
files | pidgin/plugins/musicmessaging/musicmessaging.c |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/plugins/musicmessaging/musicmessaging.c Thu Aug 23 18:34:31 2007 +0000 +++ b/pidgin/plugins/musicmessaging/musicmessaging.c Thu Aug 23 20:54:30 2007 +0000 @@ -71,10 +71,10 @@ /* Globals */ /* List of sessions */ -GList *conversations; +static GList *conversations; /* Pointer to this plugin */ -PurplePlugin *plugin_pointer; +static PurplePlugin *plugin_pointer; /* Define types needed for DBus */ DBusGConnection *connection; @@ -350,7 +350,16 @@ static gboolean intercept_received(PurpleAccount *account, char **sender, char **message, PurpleConversation *conv, int *flags) { - MMConversation *mmconv = mmconv_from_conv(conv); + MMConversation *mmconv; + + if (conv == NULL) { + /* XXX: This is just to avoid a crash (#2726). + * We may want to create the conversation instead of returning from here + */ + return FALSE; + } + + mmconv = mmconv_from_conv(conv); purple_debug_misc("purple-musicmessaging", "Intercepted: %s\n", *message); if (strstr(*message, MUSICMESSAGING_PREFIX))