Refine code to fix potential code bug.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14948 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2013-12-09 03:21:29 +00:00 committed by ydong10
parent 42f75495f3
commit 05de47ef04
1 changed files with 3 additions and 2 deletions

View File

@ -2548,12 +2548,12 @@ UiDisplayMenu (
// If the screen has no menu items, and the user didn't select UiReset // If the screen has no menu items, and the user didn't select UiReset
// ignore the selection and go back to reading keys. // ignore the selection and go back to reading keys.
// //
ASSERT(MenuOption != NULL);
if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) { if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) {
ControlFlag = CfReadKey; ControlFlag = CfReadKey;
break; break;
} }
ASSERT(MenuOption != NULL);
Statement = MenuOption->ThisTag; Statement = MenuOption->ThisTag;
if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP)
|| (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) || (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)
@ -2737,6 +2737,7 @@ UiDisplayMenu (
case CfUiHotKey: case CfUiHotKey:
ControlFlag = CfRepaint; ControlFlag = CfRepaint;
ASSERT (HotKey != NULL);
gUserInput->Action = HotKey->Action; gUserInput->Action = HotKey->Action;
ControlFlag = CfExit; ControlFlag = CfExit;
break; break;