summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--javax/swing/plaf/basic/BasicTextUI.java7
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 672676a64..ac9c70bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-06-03 Roman Kennke <kennke@aicas.com>
+ PR 27418
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (damageRange): Added null check to avoid NPE.
+
+2006-06-03 Roman Kennke <kennke@aicas.com>
+
* javax/swing/text/PlainView.java
(updateDamage): Check for valid longestLine and initialize if
necessary.
diff --git a/javax/swing/plaf/basic/BasicTextUI.java b/javax/swing/plaf/basic/BasicTextUI.java
index 6fa37af5c..60c5194da 100644
--- a/javax/swing/plaf/basic/BasicTextUI.java
+++ b/javax/swing/plaf/basic/BasicTextUI.java
@@ -1039,7 +1039,12 @@ public abstract class BasicTextUI extends TextUI
Rectangle l1 = modelToView(t, p0, firstBias);
Rectangle l2 = modelToView(t, p1, secondBias);
- if (l1.y == l2.y)
+ if (l1 == null || l2 == null)
+ {
+ // Unable to determine the start or end of the selection.
+ t.repaint();
+ }
+ else if (l1.y == l2.y)
{
SwingUtilities.computeUnion(l2.x, l2.y, l2.width, l2.height, l1);
t.repaint(l1);