From e9a8d2a403255d364208fb9ecfb556cd28e14364 Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Fri, 10 Apr 2009 10:56:58 -0400
Subject: [PATCH] Resolve ticket #1118

---
 sflphone-gtk/src/actions.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c
index 3cbd51e025..67b0644b9b 100644
--- a/sflphone-gtk/src/actions.c
+++ b/sflphone-gtk/src/actions.c
@@ -761,24 +761,27 @@ sflphone_place_call ( call_t * c )
 sflphone_display_selected_codec (const gchar* codecName)
 {
 
-    call_t * selectedCall = calltab_get_selected_call(current_calls);
+    call_t * selectedCall;
     gchar* msg;
     account_t* acc;
-    if(selectedCall->accountID != NULL){
-        acc = account_list_get_by_id(selectedCall->accountID);
-        if (!acc) {
-            msg = g_markup_printf_escaped (_("IP call - %s"), codecName);
-        }
-        else {
-            msg = g_markup_printf_escaped(_("%s account- %s             %s") ,
-                (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE),
-                (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS),
-                codecName);
+
+    selectedCall =  calltab_get_selected_call(current_calls);
+    if (selectedCall) {
+        if(selectedCall->accountID != NULL){
+            acc = account_list_get_by_id(selectedCall->accountID);
+            if (!acc) {
+                msg = g_markup_printf_escaped (_("IP call - %s"), codecName);
+            }
+            else {
+                msg = g_markup_printf_escaped(_("%s account- %s             %s") ,
+                    (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE),
+                    (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS),
+                    codecName);
+            }
+            statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT);
+            g_free(msg);
         }
-        statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT);
-        g_free(msg);
     }
-
 }
 
     gchar*
-- 
GitLab