[calls] sip: origin: Bail when trying to go online but nua handle is not present



commit 5371debc57f52f50da1fd772df39197b29ea3495
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Fri Aug 27 17:40:03 2021 +0200

    sip: origin: Bail when trying to go online but nua handle is not present
    
    This fixes a segmentation fault.

 plugins/sip/calls-sip-origin.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c
index 1557e77d..af45311c 100644
--- a/plugins/sip/calls-sip-origin.c
+++ b/plugins/sip/calls-sip-origin.c
@@ -888,6 +888,12 @@ go_online (CallsAccount *account,
 
   self = CALLS_SIP_ORIGIN (account);
 
+  if (!self->nua) {
+    g_warning ("Cannot go online: nua handle not initialized");
+    g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ACC_STATE]);
+    return;
+  }
+
   if (online) {
     g_autofree char *registrar_url = NULL;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]