From 5dd6a3b0de2d18250d92ded49d541aaa5efc3b55 Mon Sep 17 00:00:00 2001 From: BitterSmile Date: Mon, 4 Mar 2024 11:46:39 +0100 Subject: [PATCH] null check --- NEG/UI/UnityUi/Buttons/BaseButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEG/UI/UnityUi/Buttons/BaseButton.cs b/NEG/UI/UnityUi/Buttons/BaseButton.cs index 2e414af..af4657b 100644 --- a/NEG/UI/UnityUi/Buttons/BaseButton.cs +++ b/NEG/UI/UnityUi/Buttons/BaseButton.cs @@ -46,6 +46,8 @@ namespace NEG.UI.UnityUi.Buttons private void OnValidate() { this.ValidateRefs(); + if(text == null || gameObject == null) + return; text.text = gameObject.name; }