Selaa lähdekoodia

Fix null in android text entry system.

(cherry picked from commit cec8e09948b71a0f56ce2dc53960cfe799a83f22)
Jason Knight 2 vuotta sitten
vanhempi
commit
42f9208593

+ 6 - 5
platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java

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