You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by vk...@apache.org on 2008/09/23 13:19:55 UTC

svn commit: r698143 - /portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java

Author: vkumar
Date: Tue Sep 23 04:19:55 2008
New Revision: 698143

URL: http://svn.apache.org/viewvc?rev=698143&view=rev
Log:
Adding null check for prinicpal

Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java?rev=698143&r1=698142&r2=698143&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/DefaultJetspeedPrincipalSynchronizer.java Tue Sep 23 04:19:55 2008
@@ -130,7 +130,7 @@
             // update / create corresponding JetspeedPrincipal first
             updatedPrincipal = synchronizePrincipalAttributes(entity);
 
-            if (updatedPrincipal != null)
+            if (updatedPrincipal != null && entityToRelationTypes.values().size() != 0)
             {
                 // loop through all relation types for this entity type
                 for (SecurityEntityRelationType relationTypeForThisEntity : entityToRelationTypes.get(entity.getType()))
@@ -308,7 +308,7 @@
                         {
                             principalAttr = principalAttrs.getAttribute(addedEntityAttr.getMappedName(), true);
                         }
-                        principalAttr.setStringValue(addedEntityAttr.getValue());
+                        if (principalAttr!=null) principalAttr.setStringValue(addedEntityAttr.getValue());
                     } 
                     catch (SecurityException e)
                     {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org