From cc3550a85e70da35e9d2629a59229f0f79529b15 Mon Sep 17 00:00:00 2001 From: Arnold Loubriat Date: Tue, 29 Sep 2026 23:38:46 +0200 Subject: [PATCH] fix: Fix a crash when typing into an empty field on Android --- adapters/android/src/event.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapters/android/src/event.rs b/adapters/android/src/event.rs index f3c6c9e38..0865402b8 100644 --- a/adapters/android/src/event.rs +++ b/adapters/android/src/event.rs @@ -128,8 +128,8 @@ fn send_text_changed( let first_difference = i as jint; env.call_method(&event, "setFromIndex", "(I)V", &[first_difference.into()]) .unwrap(); - let mut old_index = (old_u16.len() - 1) as jint; - let mut new_index = (new_u16.len() - 1) as jint; + let mut old_index = old_u16.len() as jint - 1; + let mut new_index = new_u16.len() as jint - 1; while old_index >= first_difference && new_index >= first_difference { if old_u16[old_index as usize] != new_u16[new_index as usize] { break;