From 734ea2130817262939a9fda930304f014fdd0683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20Kentt=C3=A4?= Date: Sat, 22 Feb 2025 13:28:02 +0200 Subject: [PATCH] Don't require Windows Boot Manager entry if it's not needed --- src/EfiBootEntries.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EfiBootEntries.cs b/src/EfiBootEntries.cs index f835f30..b95f3fb 100644 --- a/src/EfiBootEntries.cs +++ b/src/EfiBootEntries.cs @@ -206,9 +206,6 @@ public class EfiBootEntries { */ public void MakeOwnEntry(bool alwaysCopyFromMS, bool dryRun = false) { var (msNum, msVar, msEntry) = WindowsEntry; - if (msEntry == null) { - throw new Exception("MakeOwnEntry: Windows Boot Manager not found."); - } var (ownNum, ownVar, ownEntry) = OwnEntry; if (ownVar == null) { (ownNum, ownVar, ownEntry) = FreeEntry; @@ -236,6 +233,9 @@ public class EfiBootEntries { ownEntry.Arguments = new byte[0]; } } else { + if (msEntry == null) { + throw new Exception("MakeOwnEntry: Windows Boot Manager not found."); + } ownEntry = msEntry; ownEntry.Arguments = new byte[0]; ownEntry.Label = "HackBGRT";