]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Refine code to fix potential code bug.
authorEric Dong <eric.dong@intel.com>
Mon, 9 Dec 2013 03:21:29 +0000 (03:21 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 9 Dec 2013 03:21:29 +0000 (03:21 +0000)
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

MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c

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