From 74f45effc913c499abd5f087fea2700327478386 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 21 Feb 2017 16:38:50 +0100 Subject: [PATCH] Do not crash when get_calls null --- Classes/LinphoneManager.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index f9b7cfa3b..107a12d2b 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -2091,7 +2091,10 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) { } - (LinphoneCall *)callByCallId:(NSString *)call_id { - const bctbx_list_t *calls = linphone_core_get_calls(LC); + const bctbx_list_t *calls = linphone_core_get_calls(theLinphoneCore); + if (!calls) { + return NULL; + } bctbx_list_t *call_tmp = bctbx_list_find_custom(calls, (bctbx_compare_func)comp_call_id, [call_id UTF8String]); if (!call_tmp) { return NULL;