[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug swing/27418] NPE in BasicTextUI.damageRange.
From: |
cvs-commit at developer dot classpath dot org |
Subject: |
[Bug swing/27418] NPE in BasicTextUI.damageRange. |
Date: |
3 Jun 2006 16:09:44 -0000 |
------- Comment #3 from cvs-commit at developer dot classpath dot org
2006-06-03 16:09 -------
Subject: Bug 27418
CVSROOT: /cvsroot/classpath
Module name: classpath
Changes by: Roman Kennke <rabbit78> 06/06/03 16:07:58
Modified files:
javax/swing/plaf/basic: BasicTextUI.java
Log message:
2006-06-03 Roman Kennke <address@hidden>
PR 27418
* javax/swing/plaf/basic/BasicTextUI.java
(damageRange): Added null check to avoid NPE.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicTextUI.java?cvsroot=classpath&r1=1.83&r2=1.84
Patches:
Index: BasicTextUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- BasicTextUI.java 16 May 2006 18:57:33 -0000 1.83
+++ BasicTextUI.java 3 Jun 2006 16:07:58 -0000 1.84
@@ -1039,7 +1039,12 @@
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);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27418