diff options
| author | Jason Knight <jason@winterpixel.com> | 2023-04-12 09:18:11 -0600 |
|---|---|---|
| committer | Jason Knight <jason@winterpixel.com> | 2023-04-12 09:18:11 -0600 |
| commit | f8699d93f6abe01a85319c06f7c94911e75498aa (patch) | |
| tree | 35ce45bf263e91238677cf268749933eea0f8191 /platform/android/java/lib | |
| parent | d4dad2b2f88968ff329145f3dab5290478bae886 (diff) | |
| download | redot-engine-f8699d93f6abe01a85319c06f7c94911e75498aa.tar.gz | |
Fix potential null in android text entry system.
Diffstat (limited to 'platform/android/java/lib')
| -rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 7b628e25ed..f48dba56df 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -124,11 +124,12 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) { if (mEdit == pTextView && isFullScreenEdit() && pKeyEvent != null) { final String characters = pKeyEvent.getCharacters(); - - for (int i = 0; i < characters.length(); i++) { - final int character = characters.codePointAt(i); - GodotLib.key(0, character, 0, true); - GodotLib.key(0, character, 0, false); + if (characters != null) { + for (int i = 0; i < characters.length(); i++) { + final int character = characters.codePointAt(i); + GodotLib.key(0, character, 0, true); + GodotLib.key(0, character, 0, false); + } } } |
