From 9f7b9887cb0950bc24aa7a43b43aa5666cb405a4 Mon Sep 17 00:00:00 2001 From: Damon Nguyen Date: Mon, 22 Sep 2025 20:29:48 +0000 Subject: [PATCH] 8366149: JNI exception pending in Java_sun_awt_X11GraphicsDevice_pGetBounds of awt_GraphicsEnv.c:1484 Reviewed-by: aivanov, prr --- .../unix/native/libawt_xawt/awt/awt_GraphicsEnv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c index 1f73a3256b0..5985dd93226 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c @@ -1268,11 +1268,15 @@ Java_sun_awt_X11GraphicsDevice_pGetBounds(JNIEnv *env, jobject this, jint screen xinInfo[screen].width, xinInfo[screen].height); XFree(xinInfo); + if (!bounds) { + return NULL; + } } } else { jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (exceptionClass != NULL) { (*env)->ThrowNew(env, exceptionClass, "Illegal screen index"); + return NULL; } } }