benklop / microblog-purple

Automatically exported from code.google.com/p/microblog-purple
GNU General Public License v3.0
0 stars 0 forks source link

[PATCH] Crash when replying if disconnected #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Receive a tweet
2. Disconnect [either disconnect network, or disable the account], but leave 
the window open
3. Click on the username to reply [or RT]

What is the expected output? What do you see instead?
It should be handled gracefully, but pidgin (PortablePidgin 2.7.7, Windows XP) 
crashes instead.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Here's a patch, and a compiled DLL for Windows

Original issue reported on code.google.com by mikeage on 2 Dec 2010 at 8:02

Attachments:

GoogleCodeExporter commented 9 years ago
Oops. Hit enter too early. 

Here's the diff. Note that it's based on the diff from issue 221. If you didn't 
apply that one, the line numbers might be wrong, and the last line should read:

                if (!g_ascii_strcasecmp(cmd, "reply")) {

instead of 

                if (!g_ascii_strcasecmp(cmd, "replyall")) {

--- twitgin/twitgin.c.crash     2010-12-02 09:42:40.000000000 +0200
+++ twitgin/twitgin.c   2010-12-02 09:57:08.000000000 +0200
@@ -190,6 +190,12 @@

        if ( acct && (proto_id > 0) ) {
                purple_debug_info(DBGID, "found account with libtwitter, proto_id = %d\n", proto_id);
+
+               if (!(acct->gc)) {
+                       purple_debug_info(DBGID, "account doesn't have a GC 
[whatever that is]; probably disconnected.");
+                       return FALSE;
+               }
+
                ma = (MbAccount *)acct->gc->proto_data;

                if (!g_ascii_strcasecmp(cmd, "replyall")) {

Original comment by mikeage on 2 Dec 2010 at 8:03

Attachments:

GoogleCodeExporter commented 9 years ago
Patch merged. 

Original comment by somsaks on 3 Dec 2010 at 4:26