From 51e12da39836e05ec9569302d45d7da9a2d86042 Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Mon, 23 Dec 2024 15:27:04 +0100 Subject: [PATCH] Include method null change in initial relay check --- .../UI/Tooltips/ButtonDelegateTooltipResolver.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonDelegateTooltipResolver.cs b/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonDelegateTooltipResolver.cs index 29ad653..d388432 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonDelegateTooltipResolver.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonDelegateTooltipResolver.cs @@ -29,7 +29,8 @@ protected override void Handle(ResolveTooltipLabelEvent eventData) pressed = eventData.Button.Pressed; } else if (eventData.Button.Slot.GetComponent() is ButtonRelayBase relay - && relay.GetSyncMember(nameof(ButtonRelay.ButtonPressed)) is ISyncDelegate relayPressed) + && relay.GetSyncMember(nameof(ButtonRelay.ButtonPressed)) is ISyncDelegate relayPressed + && relayPressed.Method is not null) { pressed = relayPressed; @@ -47,8 +48,6 @@ protected override void Handle(ResolveTooltipLabelEvent eventData) return; } - if (pressed.Method is null) return; - var targetType = pressed.Method.GetMethodInfo().DeclaringType; var localeKey = $"Tooltip.{targetType.Name}.{pressed.MethodName}";