[izpack-changes] r1439 - izpack-src/branches/branch-3-8/src/lib/com/izforge/izpack/panels

noreply at berlios.de noreply at berlios.de
Thu Jun 8 18:59:26 CEST 2006


Author: tschwarze
Date: 2006-06-08 18:59:23 +0200 (Thu, 08 Jun 2006)
New Revision: 1439

Modified:
   izpack-src/branches/branch-3-8/src/lib/com/izforge/izpack/panels/RuleInputField.java
Log:
fix NullPointerException

Modified: izpack-src/branches/branch-3-8/src/lib/com/izforge/izpack/panels/RuleInputField.java
===================================================================
--- izpack-src/branches/branch-3-8/src/lib/com/izforge/izpack/panels/RuleInputField.java	2006-06-08 08:39:47 UTC (rev 1438)
+++ izpack-src/branches/branch-3-8/src/lib/com/izforge/izpack/panels/RuleInputField.java	2006-06-08 16:59:23 UTC (rev 1439)
@@ -749,17 +749,20 @@
     /*--------------------------------------------------------------------------*/
     public void caretUpdate(CaretEvent event)
     {
-        String text = activeField.getText();
-        int fieldSize = activeField.getEditLength();
-        int caretPosition = activeField.getCaretPosition();
-        int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
-
-        if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit()))
+        if (activeField != null)
         {
-            if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize)
-                    && !backstep)
+            String text = activeField.getText();
+            int fieldSize = activeField.getEditLength();
+            int caretPosition = activeField.getCaretPosition();
+            int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
+    
+            if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit()))
             {
-                activeField.transferFocus();
+                if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize)
+                        && !backstep)
+                {
+                    activeField.transferFocus();
+                }
             }
         }
     }




More information about the izpack-changes mailing list