summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-01-10 12:34:52 +0000
committerRoman Kennke <roman@kennke.org>2006-01-10 12:34:52 +0000
commitd2af1ce1f15844502d8fcb7371f2e29d02d8a565 (patch)
tree90c8bf18171cd7858a67ae81a7a3b48c3480ee24
parentd5363eb8c487e67f81531ab4022eb00d5102ee6c (diff)
downloadclasspath-d2af1ce1f15844502d8fcb7371f2e29d02d8a565.tar.gz
2006-01-10 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/peer/gtk/GdkGraphics2D.java (GdkGraphics2D(GdkGraphics2D)): Added null check for the bg field to avoid NPE.
-rw-r--r--ChangeLog6
-rw-r--r--gnu/java/awt/peer/gtk/GdkGraphics2D.java13
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fa68fae4..fce9dee59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-01-10 Roman Kennke <kennke@aicas.com>
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java
+ (GdkGraphics2D(GdkGraphics2D)): Added null check for the bg
+ field to avoid NPE.
+
+2006-01-10 Roman Kennke <kennke@aicas.com>
+
* native/jni/java-net/javanet.c
(_javanet_shutdownOutput): Replaced strerror() with
TARGET_NATIVE_LAST_ERROR_STRING() for portability.
diff --git a/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/gnu/java/awt/peer/gtk/GdkGraphics2D.java
index d07820a97..195304dce 100644
--- a/gnu/java/awt/peer/gtk/GdkGraphics2D.java
+++ b/gnu/java/awt/peer/gtk/GdkGraphics2D.java
@@ -180,11 +180,14 @@ public class GdkGraphics2D extends Graphics2D
else
fg = new Color(g.fg.getRGB());
- if (g.bg.getAlpha() != -1)
- bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
- g.bg.getAlpha());
- else
- bg = new Color(g.bg.getRGB());
+ if (g.bg != null)
+ {
+ if (g.bg.getAlpha() != -1)
+ bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
+ g.bg.getAlpha());
+ else
+ bg = new Color(g.bg.getRGB());
+ }
if (g.clip == null)
clip = null;