I am committing this for Francis. It has been approved by Sven. This fixes bug #27507.
2006-06-05 Francis Kung <[EMAIL PROTECTED]> PR 27507 * gnu/java/awt/peer/gtk/GtkImage.java (getSource): Added check to determine if in errorLoading state. * gnu/java/awt/peer/gtk/GtkToolkit.java (createImage): Added check to prevent NPE.
Index: gnu/java/awt/peer/gtk/GtkImage.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkImage.java,v retrieving revision 1.33 diff -u -r1.33 GtkImage.java --- gnu/java/awt/peer/gtk/GtkImage.java 30 May 2006 21:42:56 -0000 1.33 +++ gnu/java/awt/peer/gtk/GtkImage.java 5 Jun 2006 13:46:23 -0000 @@ -421,9 +421,12 @@ return null; int[] pixels; - synchronized(pixbufLock) + synchronized (pixbufLock) { - pixels = getPixels(); + if (!errorLoading) + pixels = getPixels(); + else + return null; } return new MemoryImageSource(width, height, nativeModel, pixels, 0, width); Index: gnu/java/awt/peer/gtk/GtkToolkit.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,v retrieving revision 1.86 diff -u -r1.86 GtkToolkit.java --- gnu/java/awt/peer/gtk/GtkToolkit.java 30 May 2006 22:36:32 -0000 1.86 +++ gnu/java/awt/peer/gtk/GtkToolkit.java 5 Jun 2006 13:46:23 -0000 @@ -184,6 +184,9 @@ public Image createImage (ImageProducer producer) { + if (producer == null) + return null; + Image image; try {