directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r660189 - /directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java
Date Mon, 26 May 2008 13:40:49 GMT
Author: pamarcelot
Date: Mon May 26 06:40:47 2008
New Revision: 660189

URL: http://svn.apache.org/viewvc?rev=660189&view=rev
Log:
Fixed potential NPEs if the Authentication has not been initialized before saving the editor.

Modified:
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java?rev=660189&r1=660188&r2=660189&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/AuthenticationPage.java
Mon May 26 06:40:47 2008
@@ -506,29 +506,46 @@
             .getServerConfiguration();
 
         // Supported Authentication Mechanisms
-        List<SupportedMechanismEnum> supportedMechanismsList = new ArrayList<SupportedMechanismEnum>();
-        for ( Object supportedMechanism : supportedMechanismsTableViewer.getCheckedElements()
)
+        if ( ( supportedMechanismsTableViewer != null ) && ( supportedMechanismsTableViewer.getTable()
!= null )
+            && ( !supportedMechanismsTableViewer.getTable().isDisposed() ) )
         {
-            supportedMechanismsList.add( ( SupportedMechanismEnum ) supportedMechanism );
+            List<SupportedMechanismEnum> supportedMechanismsList = new ArrayList<SupportedMechanismEnum>();
+            for ( Object supportedMechanism : supportedMechanismsTableViewer.getCheckedElements()
)
+            {
+                supportedMechanismsList.add( ( SupportedMechanismEnum ) supportedMechanism
);
+            }
+            configuration.setSupportedMechanisms( supportedMechanismsList );
         }
-        configuration.setSupportedMechanisms( supportedMechanismsList );
 
         // SASL Host
-        configuration.setSaslHost( saslHostText.getText() );
+        if ( ( saslHostText != null ) && ( !saslHostText.isDisposed() ) )
+        {
+            configuration.setSaslHost( saslHostText.getText() );
+        }
 
         // SASL Principal
-        configuration.setSaslPrincipal( saslPrincipalText.getText() );
+        if ( ( saslPrincipalText != null ) && ( !saslPrincipalText.isDisposed() )
)
+        {
+            configuration.setSaslPrincipal( saslPrincipalText.getText() );
+        }
 
         // Search Base DN
-        configuration.setSearchBaseDn( searchBaseDnText.getText() );
+        if ( ( searchBaseDnText != null ) && ( !searchBaseDnText.isDisposed() ) )
+        {
+            configuration.setSearchBaseDn( searchBaseDnText.getText() );
+        }
 
         // SASL Quality Of Protection
-        List<SaslQualityOfProtectionEnum> saslQoPList = new ArrayList<SaslQualityOfProtectionEnum>();
-        for ( Object qop : saslQualityOfProtectionTableViewer.getCheckedElements() )
+        if ( ( saslQualityOfProtectionTableViewer != null ) && ( saslQualityOfProtectionTableViewer.getTable()
!= null )
+            && ( !saslQualityOfProtectionTableViewer.getTable().isDisposed() ) )
         {
-            saslQoPList.add( ( SaslQualityOfProtectionEnum ) qop );
+            List<SaslQualityOfProtectionEnum> saslQoPList = new ArrayList<SaslQualityOfProtectionEnum>();
+            for ( Object qop : saslQualityOfProtectionTableViewer.getCheckedElements() )
+            {
+                saslQoPList.add( ( SaslQualityOfProtectionEnum ) qop );
+            }
+            configuration.setSaslQops( saslQoPList );
         }
-        configuration.setSaslQops( saslQoPList );
 
         // SASL Realms
         configuration.setSaslRealms( saslRealms );



Mime
View raw message