mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 13:46:21 +00: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:
@@ -280,9 +280,14 @@ jabber_leave_chat_room(const char * const room_jid)
|
|||||||
void
|
void
|
||||||
jabber_update_presence(jabber_presence_t status, const char * const msg)
|
jabber_update_presence(jabber_presence_t status, const char * const msg)
|
||||||
{
|
{
|
||||||
int pri = prefs_get_priority();
|
int pri;
|
||||||
char *show;
|
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)
|
if (pri < -128 || pri > 127)
|
||||||
pri = 0;
|
pri = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user