From 3a228cc46e0d6ee0001351876e2622133b86d260 Mon Sep 17 00:00:00 2001 From: gokcekantarci <115616017+gokcekantarci@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:51:22 +0300 Subject: [PATCH] [PTRun]Fix CultureNotFoundException Handling (#35256) --- .../PowerLauncher/ViewModel/MainViewModel.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs b/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs index 809c660cd1..5d6c55b46d 100644 --- a/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs +++ b/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs @@ -1197,9 +1197,17 @@ namespace PowerLauncher.ViewModel public static FlowDirection GetLanguageFlowDirection() { - bool isCurrentLanguageRightToLeft = System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage.TextInfo.IsRightToLeft; + try + { + bool isCurrentLanguageRightToLeft = System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage.TextInfo.IsRightToLeft; - return isCurrentLanguageRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; + return isCurrentLanguageRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; + } + catch (CultureNotFoundException ex) + { + Log.Exception($"CultureNotFoundException: {ex.Message}", ex, MethodBase.GetCurrentMethod().DeclaringType); + return FlowDirection.LeftToRight; // default FlowDirection.LeftToRight + } } protected virtual void Dispose(bool disposing)