Skip to content

Commit

Permalink
Don't create override font if previousFont is null anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Oct 27, 2024
1 parent f9724b6 commit 544d1b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
{
Expand Down

0 comments on commit 544d1b3

Please sign in to comment.