]> git.0d.be Git - empathy.git/commitdiff
Call: Cope with not having the Channel direclty after startin a call
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Mon, 7 Nov 2011 11:04:14 +0000 (11:04 +0000)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Mon, 7 Nov 2011 20:07:19 +0000 (20:07 +0000)
src/empathy-call-window.c

index 39ae6f3978c927e927a8631abf1816d00f04361b..ab7dbeef8ea3cd215d080e947ad305862297029d 100644 (file)
@@ -3507,7 +3507,13 @@ start_call (EmpathyCallWindow *self)
       TpySendingState s;
 
       g_object_get (priv->handler, "call-channel", &call, NULL);
-      s = tpy_call_channel_get_video_state (call);
+      /* If the call channel isn't set yet we're requesting it, if we're
+       * requesting it with initial video it should be PENDING_SEND when we get
+       * it */
+      if (call == NULL)
+        s = TPY_SENDING_STATE_PENDING_SEND;
+      else
+        s = tpy_call_channel_get_video_state (call);
 
       if (s == TPY_SENDING_STATE_PENDING_SEND ||
           s == TPY_SENDING_STATE_SENDING)
@@ -3528,7 +3534,8 @@ start_call (EmpathyCallWindow *self)
             }
         }
 
-      g_object_unref (call);
+      if (call != NULL)
+        g_object_unref (call);
     }
 }