Index: AttributedString.java =================================================================== --- AttributedString.java (revision 433220) +++ AttributedString.java (working copy) @@ -494,6 +494,9 @@ } public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value) { + if (attribute == null) { + throw new NullPointerException(); + } if (text.length() == 0) { throw new IllegalArgumentException(); } @@ -510,6 +513,9 @@ public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value, int start, int end) { + if (attribute == null) { + throw new NullPointerException(); + } if (start < 0 || end > text.length() || start >= end) { throw new IllegalArgumentException(); }