Hi,

This fixes a small issue where StyleSheet would generate
NullPointerException because it wasn't checking that
BoxView.getChildAllocation() could return null.

2006-11-25  Mark Wielaard  <[EMAIL PROTECTED]>

    * javax/swing/text/html/StyleSheet.java (paint): Guard
    against getChildAllocation() returning null.

Committed,

Mark

diff -u -r1.19 StyleSheet.java
--- javax/swing/text/html/StyleSheet.java       20 Nov 2006 13:47:55 -0000     
1.19
+++ javax/swing/text/html/StyleSheet.java       25 Nov 2006 18:21:24 -0000
@@ -1324,9 +1324,12 @@
                                                          : a1.getBounds();
                   ParagraphView par = (ParagraphView) v1;
                   Shape a = par.getChildAllocation(0, r1);
-                  Rectangle r = a instanceof Rectangle ? (Rectangle) a
-                                                       : a.getBounds();
-                  centerY = (int) (r.height / 2 + r.y);
+                  if (a != null)
+                    {
+                      Rectangle r = a instanceof Rectangle ? (Rectangle) a
+                                                           : a.getBounds();
+                      centerY = (int) (r.height / 2 + r.y);
+                    }
                 }
             }
           if (centerY == -1)

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to