Bug 39973 - "Crash" when account to use has no contacts
Summary: "Crash" when account to use has no contacts
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: ssh-contact (show other bugs)
Version: git master
Hardware: All All
: medium normal
Assignee: Xavier Claessens
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-08-10 02:41 UTC by Sam Hegarty
Modified: 2011-08-11 00:51 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to fix bug (620 bytes, patch)
2011-08-10 02:41 UTC, Sam Hegarty
Details | Splinter Review

Description Sam Hegarty 2011-08-10 02:41:48 UTC
Created attachment 50089 [details] [review]
patch to fix bug

When an account with no contacts is selected for use ssh-contact a "critical" error message from tp-glib is printed and an interrupt signal must be sent to the program in order to quit. 

The following is the message printed:
"(ssh-contact:11768): tp-glib-CRITICAL **: tp_connection_get_contacts_by_handle: assertion `n_handles >= 1' failed"

Attached is a patch that adds a check to make sure there is at least one "handle" before calling tp_connection_get_contacts_by_handle.
Comment 1 Sam Hegarty 2011-08-10 02:46:44 UTC
(In reply to comment #0)
> Created an attachment (id=50089) [details]
> patch to fix bug
> 
> When an account with no contacts is selected for use ssh-contact a "critical"
Added an extra word their. Was meant to be "When an account with no contacts is selected for use a". 

> error message from tp-glib is printed and an interrupt signal must be sent to
> the program in order to quit. 
> 
> The following is the message printed:
> "(ssh-contact:11768): tp-glib-CRITICAL **:
> tp_connection_get_contacts_by_handle: assertion `n_handles >= 1' failed"
> 
> Attached is a patch that adds a check to make sure there is at least one
> "handle" before calling tp_connection_get_contacts_by_handle.
Comment 2 Xavier Claessens 2011-08-11 00:51:21 UTC
The patch looks good. You should either link a git branch or use git format-patch so I can easily import the commit. Also be careful with trailing spaces, if you do "git diff" it shows them in red.

Patched merged, thanks for your contribution!

I have more changes to use latest tp-glib APIs before making a new release of ssh-contact though. I also have a patch to finish for scp-contact.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.