[gnome-control-center] Avoid null pointer dereference and remove unused variable



commit d441df289c1ad00be2dcae419c59a6a92c5c1ac1
Author: Kjartan Maraas <kmaraas gnome org>
Date:   Thu Feb 24 19:55:32 2011 +0100

    Avoid null pointer dereference and remove unused variable

 shell/gnome-control-center.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 4940f66..1488276 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -278,7 +278,7 @@ keynav_failed (GtkIconView        *current_view,
         break;
     }
 
-  if (direction == GTK_DIR_DOWN && v->next != NULL)
+  if (direction == GTK_DIR_DOWN && v != NULL && v->next != NULL)
     {
       new_view = v->next->data;
 
@@ -315,7 +315,7 @@ keynav_failed (GtkIconView        *current_view,
       res = TRUE;
     }
 
-  if (direction == GTK_DIR_UP && v->prev != NULL)
+  if (direction == GTK_DIR_UP && v != NULL && v->prev != NULL)
     {
       new_view = v->prev->data;
 



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