re PR libgcj/21064 ([4.0 only] StyleContext.addStyle causes NullPointerException)
authorRoman Kennke <roman@kennke.org>
Tue, 19 Apr 2005 10:52:03 +0000 (10:52 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 19 Apr 2005 10:52:03 +0000 (10:52 +0000)
2005-04-19  Roman Kennke  <roman@kennke.org>

PR libgcj/21064
* javax/swing/text/StyleContext.java
(NamedStyle.setResolveParent): Added null
pointer check.

From-SVN: r98402

libjava/ChangeLog
libjava/javax/swing/text/StyleContext.java

index 66ba74a3469d4aec6e5be54f516aac7bfe1f0bcf..686453de5de710d4682a404601fb08cac7ad4006 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-19  Roman Kennke  <roman@kennke.org>
+
+       PR libgcj/21064
+       * javax/swing/text/StyleContext.java
+       (NamedStyle.setResolveParent): Added null
+       pointer check.
+
 2005-04-19  Michael Koch  <konqueror@gmx.de>
 
        * java/rmi/server/RemoteObject.java:
index beb809b89e4835f4a760df2d5c7d730f03a43696..86ccc112c11660fd910215baa23690128a887e7e 100644 (file)
@@ -203,7 +203,11 @@ public class StyleContext
 
     public void setResolveParent(AttributeSet parent)
     {
-      attributes = StyleContext.this.addAttribute(attributes, ResolveAttribute, parent);
+      if (parent != null)
+        {
+          attributes = StyleContext.this.addAttribute
+            (attributes, ResolveAttribute, parent);
+        }
       fireStateChanged();
     }