1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

fix crash on changing priority when disconnected

sending presence causes null pointer dereference when disconnected
because ctx variable isn't set
This commit is contained in:
Dmitry Podgorny 2012-11-14 00:18:54 +02:00
parent 1824704466
commit aba1ea5133

View File

@ -280,9 +280,14 @@ jabber_leave_chat_room(const char * const room_jid)
void
jabber_update_presence(jabber_presence_t status, const char * const msg)
{
int pri = prefs_get_priority();
int pri;
char *show;
// don't send presence when disconnected
if (jabber_conn.conn_status != JABBER_CONNECTED)
return;
pri = prefs_get_priority();
if (pri < -128 || pri > 127)
pri = 0;