summaryrefslogtreecommitdiff
path: root/native/jni
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2007-04-04 22:58:54 +0000
committerMark Wielaard <mark@klomp.org>2007-04-04 22:58:54 +0000
commite80ab36f051362974b356490563a9f2af8261a76 (patch)
tree7d5103ce3f386cdb7060d98a6a0cd2ecdb293bde /native/jni
parent92e47e958daba7783fc0db2ad9445919081139d6 (diff)
downloadclasspath-e80ab36f051362974b356490563a9f2af8261a76.tar.gz
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
(cp_gtk_image_get_pixbuf): Return NULL when pointer is NULL. * gnu/java/awt/peer/gtk/GtkImage.java (setImage): Set loaded and call deliver() after pixels have been set. * gnu/java/awt/peer/gtk/GtkFramePeer.java (setIconImage): Only set icon when image has been properly loaded.
Diffstat (limited to 'native/jni')
-rw-r--r--native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
index 8805ae7b3..ae7027e76 100644
--- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
+++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
@@ -1,5 +1,5 @@
/* gtkimage.c
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -368,6 +368,9 @@ GdkPixbuf *cp_gtk_image_get_pixbuf (JNIEnv *env, jobject obj)
g_assert (data_fid != 0);
data = (*env)->GetObjectField (env, obj, data_fid);
+ if (data == NULL)
+ return NULL;
+
return (GdkPixbuf *)JCL_GetRawData (env, data);
}