From efbf5e75db6731306163bc2e5fd727d230048223 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Wed, 18 Apr 2012 15:32:42 -0400
Subject: [PATCH] * #9847: SIPVoipLink: gracefully handle invalid pointers

---
 daemon/src/sip/sipvoiplink.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp
index 603db92656..8fbf682dca 100644
--- a/daemon/src/sip/sipvoiplink.cpp
+++ b/daemon/src/sip/sipvoiplink.cpp
@@ -1411,14 +1411,13 @@ void outgoing_request_forked_cb(pjsip_inv_session * /*inv*/, pjsip_event * /*e*/
 void transaction_state_changed_cb(pjsip_inv_session * inv,
                                   pjsip_transaction *tsx, pjsip_event *event)
 {
-    assert(tsx);
-    assert(event);
-
-    if (tsx->role != PJSIP_ROLE_UAS || tsx->state != PJSIP_TSX_STATE_TRYING)
+    if (!tsx or !event or tsx->role != PJSIP_ROLE_UAS or
+            tsx->state != PJSIP_TSX_STATE_TRYING)
         return;
 
-    if (pjsip_method_cmp(&tsx->method, &pjsip_refer_method) ==0) {
-        onCallTransfered(inv, event->body.tsx_state.src.rdata);          /** Handle the refer method **/
+    // Handle the refer method
+    if (pjsip_method_cmp(&tsx->method, &pjsip_refer_method) == 0) {
+        onCallTransfered(inv, event->body.tsx_state.src.rdata);
         return;
     }
 
-- 
GitLab