From 9bb0145b424238238fc43c9218eb28bdabc395e6 Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Wed, 29 Apr 2020 02:10:45 +0200 Subject: [PATCH] Fix MUI_CONTAINSKEY_BEFORE_GET in LjubesicPandzicStemmer --- .../extra/analysis/serbian/LjubesicPandzicStemmer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extra-analysis-serbian/src/main/java/org/wikimedia/search/extra/analysis/serbian/LjubesicPandzicStemmer.java b/extra-analysis-serbian/src/main/java/org/wikimedia/search/extra/analysis/serbian/LjubesicPandzicStemmer.java index efeb608..f12e477 100644 --- a/extra-analysis-serbian/src/main/java/org/wikimedia/search/extra/analysis/serbian/LjubesicPandzicStemmer.java +++ b/extra-analysis-serbian/src/main/java/org/wikimedia/search/extra/analysis/serbian/LjubesicPandzicStemmer.java @@ -216,8 +216,9 @@ private String convertCyrrilicToLatinString(String word) { /* Convert a single Cyrillic character to Latin character or digraph. */ private String convertCyrillicToLatinCharacter(char character) { - if (cyr2LatMap.containsKey(character)) { - return cyr2LatMap.get(character); + String latinCharacter = cyr2LatMap.get(character); + if (latinCharacter != null) { + return latinCharacter; } return Character.toString(character); }