From 518d7c8a9705007715e7fd868500a0c850059c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20Kentt=C3=A4?= Date: Wed, 20 Dec 2023 07:00:03 +0200 Subject: [PATCH] Show proper message if boot log is empty --- src/Efi.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Efi.cs b/src/Efi.cs index 4f6d7fd..d6724be 100644 --- a/src/Efi.cs +++ b/src/Efi.cs @@ -494,6 +494,9 @@ public class Efi { public static string GetHackBGRTLog() { try { var log = GetVariable("HackBGRTLog", EFI_HACKBGRT_GUID); + if (log.Data == null) { + return "(null)"; + } return new string(BytesToUInt16s(log.Data).Select(i => (char)i).ToArray()); } catch (Exception e) { return $"Log not found: {e.ToString()}";