From d686ccfd766ffe289a6b6b0f296c72dbbce11a5c Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 12 Jan 2021 02:17:59 +0100 Subject: [PATCH] ELF: Don't crash in GetSections() on non-existing name --- Il2CppInspector.Common/FileFormatStreams/ElfReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/FileFormatStreams/ElfReader.cs b/Il2CppInspector.Common/FileFormatStreams/ElfReader.cs index 6d32b82..305dd9b 100644 --- a/Il2CppInspector.Common/FileFormatStreams/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatStreams/ElfReader.cs @@ -502,7 +502,7 @@ namespace Il2CppInspector IsExec = ((Elf) conv.Int(s.sh_flags) & Elf.SHF_EXECINSTR) == Elf.SHF_EXECINSTR && (Elf) s.sh_type == Elf.SHT_PROGBITS, IsBSS = (Elf) s.sh_type == Elf.SHT_NOBITS, - Name = SectionByName.First(sbn => conv.Int(sbn.Value.sh_offset) == conv.Int(s.sh_offset)).Key + Name = SectionByName.FirstOrDefault(sbn => conv.Int(sbn.Value.sh_offset) == conv.Int(s.sh_offset)).Key ?? string.Empty }); }