1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2025-01-06 03:25:31 +00:00

sip: origin: Prevent dialing when not online

Setting up the nua context could have failed (see #379) and in that case
our nua_*() calls might derefence a NULL pointer.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-12-15 20:00:53 +01:00
parent ad05b0a28d
commit 73cf5081d0

View file

@ -282,6 +282,12 @@ dial (CallsOrigin *origin,
return;
}
if (calls_account_get_state (CALLS_ACCOUNT (origin)) != CALLS_ACCOUNT_ONLINE) {
g_warning ("Tried dialing on origin '%s', but it's not online",
name);
return;
}
self = CALLS_SIP_ORIGIN (origin);
nh = nua_handle (self->nua, self->oper,