From 1cb4bbaf78c2f610e08a8e4d26beb74e6f904ec0 Mon Sep 17 00:00:00 2001 From: bd_ Date: Fri, 29 Dec 2023 16:26:15 +0900 Subject: [PATCH] fix: uncaught exceptions from language change callbacks stop subsequent callbacks --- Editor/UI/Localization/LanguagePrefs.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Editor/UI/Localization/LanguagePrefs.cs b/Editor/UI/Localization/LanguagePrefs.cs index fdcb321..186ebbe 100644 --- a/Editor/UI/Localization/LanguagePrefs.cs +++ b/Editor/UI/Localization/LanguagePrefs.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Runtime.CompilerServices; +using UnityEngine; namespace nadena.dev.ndmf.localization { @@ -84,7 +85,14 @@ private static void TriggerLanguageChangeCallbacks() { foreach (Action op in new List(_onLanguageChangeCallbacks)) { - op(); + try + { + op(); + } + catch (Exception e) + { + Debug.LogException(e); + } } } }