Mercurial > pidgin
comparison src/gtkwhiteboard.c @ 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 | 7432bea7f7e6 |
children |
comparison
equal
deleted
inserted
replaced
13635:2c84df43f126 | 13636:293088b65dac |
---|---|
96 return &ui_ops; | 96 return &ui_ops; |
97 } | 97 } |
98 | 98 |
99 static void gaim_gtk_whiteboard_create(GaimWhiteboard *wb) | 99 static void gaim_gtk_whiteboard_create(GaimWhiteboard *wb) |
100 { | 100 { |
101 GaimBuddy *buddy; | |
101 GtkWidget *window; | 102 GtkWidget *window; |
102 GtkWidget *drawing_area; | 103 GtkWidget *drawing_area; |
103 GtkWidget *vbox_controls; | 104 GtkWidget *vbox_controls; |
104 GtkWidget *hbox_canvas_and_controls; | 105 GtkWidget *hbox_canvas_and_controls; |
105 | 106 |
118 GtkWidget *save_button; | 119 GtkWidget *save_button; |
119 GtkWidget *color_button; | 120 GtkWidget *color_button; |
120 | 121 |
121 GaimGtkWhiteboard *gtkwb = g_new0(GaimGtkWhiteboard, 1); | 122 GaimGtkWhiteboard *gtkwb = g_new0(GaimGtkWhiteboard, 1); |
122 | 123 |
123 const char *window_title; | |
124 | |
125 gtkwb->wb = wb; | 124 gtkwb->wb = wb; |
126 wb->ui_data = gtkwb; | 125 wb->ui_data = gtkwb; |
127 | 126 |
128 /* Get dimensions (default?) for the whiteboard canvas */ | 127 /* Get dimensions (default?) for the whiteboard canvas */ |
129 if (!gaim_whiteboard_get_dimensions(wb, >kwb->width, >kwb->height)) | 128 if (!gaim_whiteboard_get_dimensions(wb, >kwb->width, >kwb->height)) |
145 gtk_widget_set_name(window, wb->who); | 144 gtk_widget_set_name(window, wb->who); |
146 | 145 |
147 /* Try and set window title as the name of the buddy, else just use their | 146 /* Try and set window title as the name of the buddy, else just use their |
148 * username | 147 * username |
149 */ | 148 */ |
150 window_title = gaim_contact_get_alias(gaim_buddy_get_contact(gaim_find_buddy(wb->account, wb->who))); | 149 buddy = gaim_find_buddy(wb->account, wb->who); |
151 if(window_title) | 150 |
152 gtk_window_set_title((GtkWindow*)(window), window_title); | 151 if (buddy != NULL) |
152 gtk_window_set_title((GtkWindow*)(window), gaim_buddy_get_contact_alias(buddy)); | |
153 else | 153 else |
154 gtk_window_set_title((GtkWindow*)(window), wb->who); | 154 gtk_window_set_title((GtkWindow*)(window), wb->who); |
155 | 155 |
156 gtk_window_set_resizable((GtkWindow*)(window), FALSE); | 156 gtk_window_set_resizable((GtkWindow*)(window), FALSE); |
157 | 157 |