Workaround a crash

Julien LepillerSat Jul 16 14:50:19+0200 2022

ae01d3c

Workaround a crash

app/src/main/java/eu/lepiller/nani/MainActivity.java

231231
232232
            List<String> kanji = new ArrayList<>();
233233
            for(String c: text.split("")) {
234-
                if(Character.UnicodeBlock.of(c.codePointAt(0)) == CJK_UNIFIED_IDEOGRAPHS) {
234+
                if(c.isEmpty()) {
235+
                    Log.w(TAG, "Splitting text " + text + "gave an empty component");
236+
                } else if (Character.UnicodeBlock.of(c.codePointAt(0)) == CJK_UNIFIED_IDEOGRAPHS) {
235237
                    kanji.add(c);
236238
                }
237239
            }