Avoid null pointer dereference and remove unused variable

This commit is contained in:
Kjartan Maraas 2011-02-24 19:55:32 +01:00
parent dd7d6aa484
commit d441df289c

View file

@ -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;