[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/panel/replication WindowsAgreementDestinationPanel.java, 1.1.1.1, 1.2

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Tue Oct 16 16:41:46 UTC 2007


Author: nkinder

Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32690

Modified Files:
	WindowsAgreementDestinationPanel.java 
Log Message:
Resolves: 333171
Summary: Deal with illegal input for port field when setting up sync agreement.



Index: WindowsAgreementDestinationPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/replication/WindowsAgreementDestinationPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- WindowsAgreementDestinationPanel.java	18 Jul 2005 00:56:11 -0000	1.1.1.1
+++ WindowsAgreementDestinationPanel.java	16 Oct 2007 16:41:44 -0000	1.2
@@ -1174,10 +1174,15 @@
     
     private boolean domainControllerPortIsValid()
     {
-        if(_domainControllerPort.getText().length() > 0
-            && Integer.parseInt(_domainControllerPort.getText()) > 0)
-        {
-            return true;
+        if(_domainControllerPort.getText().length() > 0) {
+            try {
+                if (Integer.parseInt(_domainControllerPort.getText()) > 0) {
+                    return true;
+                }
+            } catch (NumberFormatException e) {
+                /* Someone likely entered some non-numeric text.  Just
+                 * do nothing here so we fall through and return false. */
+            }
         }
         return false;
     }




More information about the Fedora-directory-commits mailing list