Fix potential null in android text entry system.

This commit is contained in:
Jason Knight 2023-04-12 09:18:11 -06:00
parent d4dad2b2f8
commit f8699d93f6

View File

@ -124,11 +124,12 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene
public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) { public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) {
if (mEdit == pTextView && isFullScreenEdit() && pKeyEvent != null) { if (mEdit == pTextView && isFullScreenEdit() && pKeyEvent != null) {
final String characters = pKeyEvent.getCharacters(); final String characters = pKeyEvent.getCharacters();
if (characters != null) {
for (int i = 0; i < characters.length(); i++) { for (int i = 0; i < characters.length(); i++) {
final int character = characters.codePointAt(i); final int character = characters.codePointAt(i);
GodotLib.key(0, character, 0, true); GodotLib.key(0, character, 0, true);
GodotLib.key(0, character, 0, false); GodotLib.key(0, character, 0, false);
}
} }
} }