Преглед на файлове

Fix null in android text entry system.

Jason Knight преди 2 години
родител
ревизия
cec8e09948
променени са 1 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. 6 5
      platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java

+ 6 - 5
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 (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(ch, 0, ch, true);
-				GodotLib.key(ch, 0, ch, false);
+			if (characters != null) {
+				for (int i = 0; i < characters.length(); i++) {
+					final int ch = characters.codePointAt(i);
+					GodotLib.key(ch, 0, ch, true);
+					GodotLib.key(ch, 0, ch, false);
+				}
 			}
 		}