Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
---
 MdeModulePkg/Library/BootManagerLib/BootManager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c 
b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedeb..dd87250 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -325,10 +325,13 @@ GroupMultipleLegacyBootOption4SameType (
   EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
 
   SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
 
   GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize);
+  if (BootOrder == NULL) {
+    return;
+  }
 
   for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
     UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", 
BootOrder[Index]);
     Status = EfiBootManagerVariableToLoadOption (OptionName, &BootOption);
     ASSERT_EFI_ERROR (Status);
-- 
2.6.4.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to