From: Po Lu Date: Fri, 28 Jul 2023 07:24:47 +0000 (+0800) Subject: Avoid crashes when the primary clip is empty X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3f4653400f1ad0ac07d9a4ac905777772494f41d;p=emacs.git Avoid crashes when the primary clip is empty * src/androidselect.c (Fandroid_get_clipboard): Don't return data if clipboard is empty. Reported by Johan Widén . --- diff --git a/src/androidselect.c b/src/androidselect.c index f5371280457..9910e7921de 100644 --- a/src/androidselect.c +++ b/src/androidselect.c @@ -194,6 +194,9 @@ Alternatively, return nil if the clipboard is empty. */) method); android_exception_check (); + if (!bytes) + return Qnil; + length = (*android_java_env)->GetArrayLength (android_java_env, bytes); data = (*android_java_env)->GetByteArrayElements (android_java_env,