Formats: Allow LoadOptions to be null

This commit is contained in:
Katy Coe
2021-01-12 00:21:57 +01:00
parent 68d251926d
commit 61eb6964fc
3 changed files with 4 additions and 4 deletions

View File

@@ -203,13 +203,13 @@ namespace Il2CppInspector
// Dumped images must be rebased
if (isMemoryImage) {
if (LoadOptions.ImageBase == 0)
if (LoadOptions == null || LoadOptions.ImageBase == 0)
throw new InvalidOperationException("To load a dumped ELF image, you must specify the image base virtual address");
}
// Rebase if requested (whether dumped or not) and treat it as a memory image,
// disabling processing of relocations, symbols and decryption
if (LoadOptions.ImageBase != 0) {
if (LoadOptions?.ImageBase != 0) {
isMemoryImage = true;
rebase(conv.FromULong(LoadOptions.ImageBase));
}