From: Mikael Magnusson Date: Thu, 29 Apr 2010 20:11:17 +0000 (-0400) Subject: don't dereference NULL pointer when there is nothing selected and pressing right X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=5416633ea89750ad7edb5ecb0f1106aa1775a079;p=mikachu%2Fopenbox.git don't dereference NULL pointer when there is nothing selected and pressing right --- diff --git a/openbox/event.c b/openbox/event.c index f7fe030d..1c6c043c 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1725,7 +1725,9 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) else if (ob_keycode_match(keycode, OB_KEY_RIGHT)) { /* Right goes to the selected submenu */ - if (frame->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) { + if (frame->selected && + frame->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + { /* make sure it is visible */ menu_frame_select(frame, frame->selected, TRUE); menu_frame_select_next(frame->child);