From c144e361c6e7296790edb3f0bf593ad56b57e9c1 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sat, 18 Jan 2020 22:26:11 +0100 Subject: [PATCH] Output: Fix crash regression with edge case explicit interface property output --- Il2CppDumper/Il2CppCSharpDumper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Il2CppDumper/Il2CppCSharpDumper.cs b/Il2CppDumper/Il2CppCSharpDumper.cs index bf61e74..5a7dbf2 100644 --- a/Il2CppDumper/Il2CppCSharpDumper.cs +++ b/Il2CppDumper/Il2CppCSharpDumper.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2019 Katy Coe - http://www.djkaty.com - https://github.com/djkaty +// Copyright (c) 2017-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty // All rights reserved using System; @@ -282,7 +282,8 @@ namespace Il2CppInspector var getAccess = (prop.GetMethod?.Attributes ?? 0) & MethodAttributes.MemberAccessMask; var setAccess = (prop.SetMethod?.Attributes ?? 0) & MethodAttributes.MemberAccessMask; - var primary = getAccess >= setAccess ? prop.GetMethod : prop.SetMethod; + // In case the access level of both is the same and the selected method is null, pick the other one (rare edge case) + var primary = (getAccess >= setAccess ? prop.GetMethod : prop.SetMethod) ?? prop.GetMethod ?? prop.SetMethod; sb.Append($"{prefix}\t{primary.GetModifierString()}{prop.PropertyType.GetScopedCSharpName(scope)} "); // Non-indexer; non-auto-properties should have a body