Fix a segfault when not connected to a server
Bug reported by Mario Iseli.
--- a/mcabber/src/screen.c Fri Apr 14 19:17:09 2006 +0200
+++ b/mcabber/src/screen.c Fri Apr 14 20:38:35 2006 +0200
@@ -851,18 +851,26 @@
// at least to refresh the pending message flag.
scr_UpdateMainStatus(FALSE);
+ // Clear the line
+ werase(chatstatusWnd);
+
+ if (chatmode)
+ wprintw(chatstatusWnd, "~");
+
+ if (!current_buddy) {
+ if (forceupdate) {
+ update_panels();
+ doupdate();
+ }
+ return;
+ }
+
fullname = buddy_getname(BUDDATA(current_buddy));
btype = buddy_gettype(BUDDATA(current_buddy));
isgrp = btype & ROSTER_TYPE_GROUP;
ismuc = btype & ROSTER_TYPE_ROOM;
- // Clear the line
- werase(chatstatusWnd);
-
- if (chatmode)
- wprintw(chatstatusWnd, "~");
-
if (isgrp) {
buf_locale = from_utf8(fullname);
mvwprintw(chatstatusWnd, 0, 5, "Group: %s", buf_locale);