Commit 9fe7d4f
Fix TypeError when languageText called with non-language object
VAutocomplete eagerly evaluates getText(internalValue) as the fallback
argument to getValue, even when the fallback is never used. In multiple
mode (used in SearchFilters), internalValue is an Array of selected ids.
Arrays are objects in JS, so getPropertyFromItem does not short-circuit
on the primitive guard and calls languageText with the array directly.
Since arrays have no native_name property, this throws a TypeError.
Guard languageText against item being null/undefined or lacking a
native_name (covers arrays, partial objects, and any future edge cases).
Fixes #5740.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c2f2777 commit 9fe7d4f
2 files changed
Lines changed: 28 additions & 0 deletions
File tree
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
84 | 105 | | |
0 commit comments