summaryrefslogtreecommitdiff
path: root/javax/swing/tree/VariableHeightLayoutCache.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/tree/VariableHeightLayoutCache.java')
-rw-r--r--javax/swing/tree/VariableHeightLayoutCache.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/javax/swing/tree/VariableHeightLayoutCache.java b/javax/swing/tree/VariableHeightLayoutCache.java
index 03251eb1f..b256f1fe9 100644
--- a/javax/swing/tree/VariableHeightLayoutCache.java
+++ b/javax/swing/tree/VariableHeightLayoutCache.java
@@ -339,6 +339,12 @@ public class VariableHeightLayoutCache
return null;
if (dirty)
update();
+
+ // The RI allows null arguments for rect, in which case a new Rectangle
+ // is created.
+ if (rect == null)
+ rect = new Rectangle();
+
Object last = path.getLastPathComponent();
NodeRecord r = (NodeRecord) nodes.get(last);
if (r == null)