diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 31d3418c61..b8ea246467 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -147,7 +147,7 @@ BmFindBootOptionInVariable ( if (OptionNumber == LoadOptionNumberUnassigned) { BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot); - if (BootOptions == NULL) { + if ((BootOptions == NULL) && (BootOptionCount > 0)) { ASSERT (BootOptions != NULL); return LoadOptionNumberUnassigned; }