summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/BootManagerLib/BootManager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedebc88..dd87250743 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -327,6 +327,9 @@ GroupMultipleLegacyBootOption4SameType (
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]);