diff --git a/src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs b/src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs index 24598de..9036b56 100644 --- a/src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs +++ b/src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs @@ -129,8 +129,9 @@ public void ChangeFont( object ui ) var fontProperty = clrType.CachedProperty( "font" ); var previousFont = fontProperty.Get( ui ); + if( previousFont == null ) return; var newFont = FontCache.GetOrCreateOverrideFontTextMeshPro(); - if( newFont == null || previousFont == null ) return; + if( newFont == null ) return; if( !UnityObjectReferenceComparer.Default.Equals( newFont, previousFont ) ) {