harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r599529 - /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
Date Thu, 29 Nov 2007 17:49:58 GMT
Author: apetrenko
Date: Thu Nov 29 09:49:56 2007
New Revision: 599529

URL: http://svn.apache.org/viewvc?rev=599529&view=rev
Log:
Patch for HARMONY-5222 "[classlib][swing] ComboBox.setEditor throws NPE 
if editor is null"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java?rev=599529&r1=599528&r2=599529&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
Thu Nov 29 09:49:56 2007
@@ -407,11 +407,16 @@
     }
 
     public void addEditor() {
-        editor = comboBox.getEditor().getEditorComponent();
-        if (editor != null) {
-            configureEditor();
-            comboBox.add(editor);
-        }
+        ComboBoxEditor cbe = comboBox.getEditor();
+        if (cbe == null)
+            return;
+            
+        editor = cbe.getEditorComponent();
+        if (editor == null)
+            return;
+        
+        configureEditor();
+        comboBox.add(editor);
     }
 
     public void removeEditor() {



Mime
View raw message