We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7faaa1e commit d6e1601Copy full SHA for d6e1601
app/src/main/java/org/wikipedia/edit/insertmedia/InsertMediaViewModel.kt
@@ -220,7 +220,10 @@ class InsertMediaViewModel(bundle: Bundle) : ViewModel() {
220
}
221
222
223
- if (autoInsert && attemptInfobox && infoboxMatch != null) {
+ // Verify a few conditions before attempting to insert into an infobox, including
224
+ // whether the infobox actually exists, and whether the current language wiki is
225
+ // supported by our hardcoded infoboxVars.
226
+ if (autoInsert && attemptInfobox && infoboxMatch != null && infoboxVarsByLang.containsKey(langCode)) {
227
val infoboxStartIndex = infoboxMatch.range.first
228
val infoboxEndIndex = infoboxMatch.range.last
229
0 commit comments