changeset 13410:184d62658af2

[gaim-migrate @ 15785] Cleanup the NULL checks in this function. Resolves CID 67 Resolves CID 68 Resolves CID 69 committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 06 Mar 2006 21:40:22 +0000
parents 0a3c968b07dc
children 0d223f4ee868
files src/gtkwhiteboard.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkwhiteboard.c	Mon Mar 06 21:35:26 2006 +0000
+++ b/src/gtkwhiteboard.c	Mon Mar 06 21:40:22 2006 +0000
@@ -296,7 +296,10 @@
 void gaim_gtk_whiteboard_exit(GtkWidget *widget, gpointer data)
 {
 	GaimGtkWhiteboard *gtkwb = (GaimGtkWhiteboard*)data;
-	GaimWhiteboard *wb = gtkwb->wb;
+	GaimWhiteboard *wb;
+
+	g_return_if_fail(gtkwb != NULL);
+	wb = gtkwb->wb;
 
 	if(gtkwb->window && gtkwb->pixmap)
 	{
@@ -307,12 +310,8 @@
 	else
 		LocalShutdownRequest = FALSE;
 
-	if(gtkwb)
-	{
-		g_free(gtkwb);
-
-		wb->ui_data = NULL;
-	}
+	g_free(gtkwb);
+	wb->ui_data = NULL;
 
 	/* Destroy whiteboard core, if the local user exited the whiteboard window */
 	if(wb && LocalShutdownRequest)