Skip to content

Fix crash on corrupt Windows language installation#1507

Merged
imnasnainaec merged 4 commits into
masterfrom
fix-761-windows-language-crash
Jun 18, 2026
Merged

Fix crash on corrupt Windows language installation#1507
imnasnainaec merged 4 commits into
masterfrom
fix-761-windows-language-crash

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #761

WritingSystemFromWindowsLocaleProvider.GetLanguageAndKeyboardCombinations accessed InputLanguage.LayoutName unguarded, which can throw a NullReferenceException from System.Windows.Forms when a user has a corrupt Windows language installation. Read the layout name inside a try/catch and skip the offending language instead of crashing the whole enumeration.

Devin review: https://app.devin.ai/review/sillsdev/libpalaso/pull/1507


This change is Reviewable

WritingSystemFromWindowsLocaleProvider.GetLanguageAndKeyboardCombinations
accessed InputLanguage.LayoutName unguarded, which can throw a
NullReferenceException from System.Windows.Forms when a user has a corrupt
Windows language installation. Read the layout name inside a try/catch and
skip the offending language instead of crashing the whole enumeration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imnasnainaec imnasnainaec self-assigned this Jun 16, 2026
@imnasnainaec imnasnainaec marked this pull request as ready for review June 16, 2026 18:20
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

Palaso Tests

     4 files  ±0       4 suites  ±0   9m 25s ⏱️ -31s
 5 102 tests ±0   4 869 ✅ ±0  233 💤 ±0  0 ❌ ±0 
16 618 runs  ±0  15 900 ✅ +1  718 💤  - 1  0 ❌ ±0 

Results for commit 4980709. ± Comparison against base commit 3e188ee.

♻️ This comment has been updated with latest results.

@hahn-kev hahn-kev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, though I don't know the code well and I didn't test it

@imnasnainaec imnasnainaec enabled auto-merge (squash) June 18, 2026 12:59
@imnasnainaec imnasnainaec disabled auto-merge June 18, 2026 12:59
@imnasnainaec imnasnainaec enabled auto-merge (squash) June 18, 2026 12:59
@imnasnainaec imnasnainaec merged commit 1f48c0e into master Jun 18, 2026
9 checks passed
@imnasnainaec imnasnainaec deleted the fix-761-windows-language-crash branch June 18, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Corruption in Windows language leads to a crash

2 participants