From e4e3ade565f692dd6e7c622a927f1e7c6278c6ef Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 14 Apr 2014 13:26:01 +0400 Subject: [PATCH] gui/widget/menue.cpp: fix selected in case saved one do not match new menu size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a1ac9b55c918b8e09c7bc1fe1d17ffc381b9dac Author: [CST] Focus Date: 2014-04-14 (Mon, 14 Apr 2014) --- src/gui/widget/menue.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d7bd79543..c04adfa95 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -512,6 +512,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) int pos = 0; if (selected > 0 && selected < (int)items.size()) pos = selected; + else if (selected >= (int)items.size()) + selected = -1; + exit_pressed = false; frameBuffer->Lock();