Fix vulnerability of new NationPickerPopup icon view (#9587)

This commit is contained in:
SomeTroglodyte
2023-06-14 06:28:45 +02:00
committed by GitHub
parent 6a387fc7d2
commit c56644cd6d

View File

@ -230,7 +230,7 @@ internal class NationPickerPopup(
}
// Keyboard: Fist letter of each "word" - "The Ottomans" get T _and_ O
val keys = element.translatedName.split(' ').map { it.first() }.toSet()
val keys = element.translatedName.split(' ').mapNotNull { it.firstOrNull() }.toSet()
for (key in keys) {
if (key in keySelectMap) {
keySelectMap[key]!! += currentSelectInfo