Skip to content

Commit 544d1b3

Browse files
committed
Don't create override font if previousFont is null anyways
1 parent f9724b6 commit 544d1b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ public void ChangeFont( object ui )
129129
var fontProperty = clrType.CachedProperty( "font" );
130130

131131
var previousFont = fontProperty.Get( ui );
132+
if( previousFont == null ) return;
132133
var newFont = FontCache.GetOrCreateOverrideFontTextMeshPro();
133-
if( newFont == null || previousFont == null ) return;
134+
if( newFont == null ) return;
134135

135136
if( !UnityObjectReferenceComparer.Default.Equals( newFont, previousFont ) )
136137
{

0 commit comments

Comments
 (0)