mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2026-09-26 14:01:19 -07:00
Don't panic if BootCurrent is not found
This commit is contained in:
@@ -113,10 +113,10 @@ public class EfiBootEntries {
|
|||||||
cache = new Dictionary<UInt16, (Efi.Variable, BootEntryData)>();
|
cache = new Dictionary<UInt16, (Efi.Variable, BootEntryData)>();
|
||||||
BootOrder = Efi.GetVariable("BootOrder");
|
BootOrder = Efi.GetVariable("BootOrder");
|
||||||
BootCurrent = Efi.GetVariable("BootCurrent");
|
BootCurrent = Efi.GetVariable("BootCurrent");
|
||||||
if (BootOrder.Data == null || BootCurrent.Data == null) {
|
if (BootOrder.Data == null) {
|
||||||
throw new Exception("Could not read BootOrder or BootCurrent.");
|
throw new Exception("Could not read BootOrder.");
|
||||||
}
|
}
|
||||||
BootCurrentInts = new List<UInt16>(Efi.BytesToUInt16s(BootCurrent.Data));
|
BootCurrentInts = new List<UInt16>(Efi.BytesToUInt16s(BootCurrent.Data ?? new byte[0]));
|
||||||
BootOrderInts = new List<UInt16>(Efi.BytesToUInt16s(BootOrder.Data));
|
BootOrderInts = new List<UInt16>(Efi.BytesToUInt16s(BootOrder.Data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user