Skip to content

Commit

Permalink
fix(android): icText null check
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorton committed Feb 29, 2024
1 parent 7ed5ae4 commit 944e668
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ protected boolean updateSelectionRange(int selStart, int selEnd) {
InputConnection ic = KMManager.getInputConnection(this.keyboardType);
if (ic != null) {
ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0);
String rawText = icText.text.toString();
if (icText != null) {
updateText(rawText.toString());
if (icText == null) {
return false;
}

String rawText = icText.text.toString();
updateText(rawText.toString());

/*
The values of selStart & selEnd provided by the system are in code units,
not code-points. We need to account for surrogate pairs here.
Expand Down

0 comments on commit 944e668

Please sign in to comment.