From 169cbaac09cc0656c46869ae7455d9159675bfcc Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 23 May 2013 15:20:30 +0200 Subject: [PATCH] Add check to prevent crash. --- tester/call_tester.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index aff361f20..a5d05e0e4 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -419,13 +419,15 @@ static bool_t check_ice(LinphoneCoreManager* caller, LinphoneCoreManager* callee CU_ASSERT_PTR_NOT_NULL(c2); for (i=0;i<200;i++){ - if (linphone_call_get_audio_stats(c1)->ice_state==LinphoneIceStateHostConnection && - linphone_call_get_audio_stats(c2)->ice_state==LinphoneIceStateHostConnection ){ - success=TRUE; - break; + if ((c1 != NULL) && (c2 != NULL)) { + if (linphone_call_get_audio_stats(c1)->ice_state==LinphoneIceStateHostConnection && + linphone_call_get_audio_stats(c2)->ice_state==LinphoneIceStateHostConnection ){ + success=TRUE; + break; + } + linphone_core_iterate(caller->lc); + linphone_core_iterate(callee->lc); } - linphone_core_iterate(caller->lc); - linphone_core_iterate(callee->lc); ms_usleep(50000); } return success;