summaryrefslogtreecommitdiff
path: root/javax/swing/text/html/StyleSheet.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/text/html/StyleSheet.java')
-rw-r--r--javax/swing/text/html/StyleSheet.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/javax/swing/text/html/StyleSheet.java b/javax/swing/text/html/StyleSheet.java
index 58f1b9341..27d69bf4b 100644
--- a/javax/swing/text/html/StyleSheet.java
+++ b/javax/swing/text/html/StyleSheet.java
@@ -1324,9 +1324,12 @@ public class StyleSheet extends StyleContext
: 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)