Skip to content

Commit

Permalink
fix: uncaught exceptions from language change callbacks stop subseque…
Browse files Browse the repository at this point in the history
…nt callbacks
  • Loading branch information
bdunderscore committed Dec 29, 2023
1 parent 02b58c1 commit 1cb4bba
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Editor/UI/Localization/LanguagePrefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
using UnityEngine;

namespace nadena.dev.ndmf.localization
{
Expand Down Expand Up @@ -84,7 +85,14 @@ private static void TriggerLanguageChangeCallbacks()
{
foreach (Action op in new List<Action>(_onLanguageChangeCallbacks))
{
op();
try
{
op();
}
catch (Exception e)
{
Debug.LogException(e);
}
}
}
}
Expand Down

0 comments on commit 1cb4bba

Please sign in to comment.