diff options
-rw-r--r-- | ArmPlatformPkg/Bds/BootMenu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 4221238..25dc1d4 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -691,6 +691,7 @@ BootMenuReorderBootOptions ( }
SelectedEntry = &BootOptionEntry->Link;
+ SecondEntry = NULL;
// Note down the previous entry in the list to be able to cancel changes
PrevEntry = GetPreviousNode (BootOptionsList, SelectedEntry);
@@ -739,7 +740,9 @@ BootMenuReorderBootOptions ( } while ((!Move) && (!Save) && (!Cancel));
if (Move) {
- SwapListEntries (SelectedEntry, SecondEntry);
+ if ((SelectedEntry != NULL) && (SecondEntry != NULL)) {
+ SwapListEntries (SelectedEntry, SecondEntry);
+ }
} else {
if (Save) {
Status = GetGlobalEnvironmentVariable (
|