Mercurial > pidgin.yaz
diff src/protocols/gg/gg.c @ 12257:ca27de274225
[gaim-migrate @ 14559]
Patches from Bartosz Oler with some changes by me.
The summary of changes is:
1. Fix a silly bug I introduced when editing previous patches.
2. Add some error handling.
3. Unify some types.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 29 Nov 2005 19:26:03 +0000 |
parents | 64254fbabc7b |
children | 2b61f681ff99 |
line wrap: on
line diff
--- a/src/protocols/gg/gg.c Tue Nov 29 18:25:12 2005 +0000 +++ b/src/protocols/gg/gg.c Tue Nov 29 19:26:03 2005 +0000 @@ -971,6 +971,16 @@ results = gaim_notify_searchresults_new(); + if (results == NULL) { + gaim_debug_error("gg", "ggp_pubdir_reply_handler: " + "Unable to display the search results.\n"); + gaim_notify_error(gc, NULL, + _("Unable to display the search results."), + NULL); + ggp_sr_close_cb(gaim_connection_get_account(gc)); + return; + } + column = gaim_notify_searchresults_column_new(_("UIN")); gaim_notify_searchresults_column_add(results, column); @@ -1025,8 +1035,19 @@ void *h = gaim_notify_searchresults(gc, _("Gadu-Gadu Public Directory"), _("Search results"), NULL, results, - (GHookFunc)ggp_sr_close_cb, + (GaimNotifyCloseCallback)ggp_sr_close_cb, gaim_connection_get_account(gc)); + + if (h == NULL) { + gaim_debug_error("gg", "ggp_pubdir_reply_handler: " + "Unable to display the search results.\n"); + gaim_notify_error(gc, NULL, + _("Unable to display the search results."), + NULL); + ggp_sr_close_cb(gaim_connection_get_account(gc)); + return; + } + info->searchresults_window = h; } else { gaim_notify_searchresults_new_rows(gc, results,