]> www.infradead.org Git - pidgin-chime.git/commitdiff
Fix potential use of NULL chat->call
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 12 Apr 2018 09:03:11 +0000 (11:03 +0200)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 12 Apr 2018 09:03:11 +0000 (11:03 +0200)
prpl/chat.c

index 6118d02fc50ebb47fa94b2f01214c9fbe14922fc..720135fe518d1cdc86f96b303612af33baa36ae6 100644 (file)
@@ -525,11 +525,12 @@ struct chime_chat *do_join_chat(PurpleConnection *conn, ChimeConnection *cxn, Ch
                if (chat->call) {
                        g_signal_connect(chat->call, "audio-state", G_CALLBACK(on_audio_state), chat);
                        g_signal_connect(chat->call, "participants-changed", G_CALLBACK(on_call_participants), chat);
+
+                       /* We'll probably miss the first audio-state signal when it
+                        * starts connecting. Set up the call media now if needed. */
+                       if (!chime_call_get_silent(chat->call))
+                               call_media_setup(chat->call, chat);
                }
-               /* We'll probably miss the first audio-state signal when it
-                * starts connecting. Set up the call media now if needed. */
-               if (!chime_call_get_silent(chat->call))
-                       call_media_setup(chat->call, chat);
        }
 
        return chat;