Merge pull request #75991 from jasonwinterpixel/bugfix/null-characters-android

Fix potential null in android text entry system.
This commit is contained in:
Rémi Verschelde 2023-04-13 09:55:06 +02:00
commit 3e37f23ef2
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -124,13 +124,14 @@ 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();
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);
}
}
}
if (pActionID == EditorInfo.IME_ACTION_DONE) {
// Enter key has been pressed