directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1063289 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
Date Tue, 25 Jan 2011 14:14:32 GMT
Author: pamarcelot
Date: Tue Jan 25 14:14:32 2011
New Revision: 1063289

URL: http://svn.apache.org/viewvc?rev=1063289&view=rev
Log:
Fixed potential NPE.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1063289&r1=1063288&r2=1063289&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
Tue Jan 25 14:14:32 2011
@@ -403,14 +403,17 @@ public class ServerConfigurationEditor e
      */
     public void showPage( Class<?> pageClass )
     {
-        Enumeration<Object> enumeration = pages.elements();
-        while ( enumeration.hasMoreElements() )
+        if ( pageClass != null )
         {
-            Object page = enumeration.nextElement();
-            if ( pageClass.isInstance( page ) )
+            Enumeration<Object> enumeration = pages.elements();
+            while ( enumeration.hasMoreElements() )
             {
-                setActivePage( pages.indexOf( page ) );
-                return;
+                Object page = enumeration.nextElement();
+                if ( pageClass.isInstance( page ) )
+                {
+                    setActivePage( pages.indexOf( page ) );
+                    return;
+                }
             }
         }
     }



Mime
View raw message