changeset 13636:293088b65dac

[gaim-migrate @ 16034] Fix Coverity CID 117, gaim_find_buddy can return NULL committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 15 Apr 2006 14:29:30 +0000
parents 2c84df43f126
children 83ec59aefbe5
files src/gtkwhiteboard.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkwhiteboard.c	Sat Apr 15 14:14:50 2006 +0000
+++ b/src/gtkwhiteboard.c	Sat Apr 15 14:29:30 2006 +0000
@@ -98,6 +98,7 @@
 
 static void gaim_gtk_whiteboard_create(GaimWhiteboard *wb)
 {
+	GaimBuddy *buddy;
 	GtkWidget *window;
 	GtkWidget *drawing_area;
 	GtkWidget *vbox_controls;
@@ -120,8 +121,6 @@
 
 	GaimGtkWhiteboard *gtkwb = g_new0(GaimGtkWhiteboard, 1);
 
-	const char *window_title;
-
 	gtkwb->wb = wb;
 	wb->ui_data = gtkwb;
 
@@ -147,9 +146,10 @@
 	/* Try and set window title as the name of the buddy, else just use their
 	 * username
 	 */
-	window_title = gaim_contact_get_alias(gaim_buddy_get_contact(gaim_find_buddy(wb->account, wb->who)));
-	if(window_title)
-		gtk_window_set_title((GtkWindow*)(window), window_title);
+	buddy = gaim_find_buddy(wb->account, wb->who);
+
+	if (buddy != NULL)
+		gtk_window_set_title((GtkWindow*)(window), gaim_buddy_get_contact_alias(buddy));
 	else
 		gtk_window_set_title((GtkWindow*)(window), wb->who);