[gnome-panel] panel: Move some checks around to avoid a cppcheck warning



commit 85b29891286652059cd6258de3363ffb5bdcc2c3
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Apr 19 16:16:12 2011 +0200

    panel: Move some checks around to avoid a cppcheck warning

 gnome-panel/panel.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index 8565197..8874fe6 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -868,14 +868,13 @@ move_applet (PanelWidget         *panel,
 
 	info = g_slist_nth_data (applet_list, applet_index);
 
-	if ( ! panel_applet_can_freely_move (info))
+	if (info == NULL || info->widget == NULL ||
+	    !panel_applet_can_freely_move (info))
 		return FALSE;
 
 	parent = gtk_widget_get_parent (info->widget);
 
-	if (info != NULL &&
-	    info->widget != NULL &&
-	    parent != NULL &&
+	if (parent != NULL &&
 	    PANEL_IS_WIDGET (parent)) {
 		panel_widget_reparent (PANEL_WIDGET (parent),
 				       panel,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]