From 1325fbe088516f24be488c94d7b1dcbac2fe43fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Thu, 7 Jun 2018 15:51:32 +0200 Subject: [PATCH] Prevent tests from crashing if current call is NULL --- tester/call_single_tester.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index 970c1af24..3a97089de 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -5841,9 +5841,14 @@ static void call_with_zrtp_configured_calling_base(LinphoneCoreManager *marie, L liblinphone_tester_check_rtcp(marie,pauline); - BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc))) + LinphoneCall *call = linphone_core_get_current_call(marie->lc); + if (!BC_ASSERT_PTR_NOT_NULL(call)) return; + BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)) , LinphoneMediaEncryptionZRTP, int, "%i"); - BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc))) + + call = linphone_core_get_current_call(pauline->lc); + if (!BC_ASSERT_PTR_NOT_NULL(call)) return; + BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)) , LinphoneMediaEncryptionZRTP, int, "%i"); end_call(pauline, marie); } @@ -5861,9 +5866,14 @@ static void call_with_zrtp_configured_callee_base(LinphoneCoreManager *marie, Li liblinphone_tester_check_rtcp(marie,pauline); - BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc))) + LinphoneCall *call = linphone_core_get_current_call(marie->lc); + if (!BC_ASSERT_PTR_NOT_NULL(call)) return; + BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)) , LinphoneMediaEncryptionZRTP, int, "%i"); - BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc))) + + call = linphone_core_get_current_call(pauline->lc); + if (!BC_ASSERT_PTR_NOT_NULL(call)) return; + BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)) , LinphoneMediaEncryptionZRTP, int, "%i"); end_call(pauline, marie); }