harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r616278 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java
Date Tue, 29 Jan 2008 12:07:14 GMT
Author: apetrenko
Date: Tue Jan 29 04:07:13 2008
New Revision: 616278

URL: http://svn.apache.org/viewvc?rev=616278&view=rev
Log:
Patch for HARMONY-5437 "[classlib][awt][appletviewer] Drawing of the 
checkbox with null label throws NullPointerException"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java?rev=616278&r1=616277&r2=616278&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultCheckbox.java
Tue Jan 29 04:07:13 2008
@@ -86,10 +86,13 @@
     }
 
     public static void drawText(Graphics g, TextState s, Rectangle r) {
+        String text = s.getText();
+        if (text == null){
+            return;
+        }
         int baseX = r.x;
         int h = getTextSize(s).height;
         int baseY = r.y + r.height - h / 5;
-        String text = s.getText();
         g.setFont(s.getFont());
         g.setColor(s.getTextColor());
         if (s.isEnabled()) {



Mime
View raw message