abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorJules Aguillon2024-12-23 11:04:39 +0100
committerJules Aguillon2024-12-23 11:04:39 +0100
commit2e9f69d58cec94480f8a82d4b0192b46f828adaf (patch)
tree64029b2fd74e971637f5cb76ea287ded3afc141b /srcs
parent02cbe0632ff0487c2a35d4cf7c99aa4cbb71ffb9 (diff)
downloadunexpected-keyboard-2e9f69d58cec94480f8a82d4b0192b46f828adaf.tar.gz
unexpected-keyboard-2e9f69d58cec94480f8a82d4b0192b46f828adaf.zip
Fix crash on devices with only unsupported languages
This only affected Android 12 and up.
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index 4886cc3..a68b954 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -157,6 +157,8 @@ public class Keyboard2 extends InputMethodService
// Android might return a random subtype, for example, the first in the
// list alphabetically.
InputMethodSubtype current_subtype = imm.getCurrentInputMethodSubtype();
+ if (current_subtype == null)
+ return null;
for (InputMethodSubtype s : enabled_subtypes)
if (s.getLanguageTag().equals(current_subtype.getLanguageTag()))
return s;