Skip to content

Commit 4aadd60

Browse files
Minor fix of null handling
1 parent 056b277 commit 4aadd60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

KeyboardSwitch/Services/LanguageManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public void SetCurrentLanguage()
3232
{
3333
var currentLanguage = this.LayoutManager.GetCurrentLayout();
3434

35-
if (this.CurrentLanguage == null ||
36-
this.CurrentLanguage.LCID != currentLanguage.LCID)
35+
if (currentLanguage != null &&
36+
(this.CurrentLanguage == null ||
37+
this.CurrentLanguage.LCID != currentLanguage.LCID))
3738
{
3839
Debug.Write(
3940
$"In {nameof(this.SetCurrentLanguage)}(): " +

0 commit comments

Comments
 (0)