syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1488863 - in /syncope/trunk: ./ core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
Date Mon, 03 Jun 2013 07:03:07 GMT
Author: ilgrosso
Date: Mon Jun  3 07:03:07 2013
New Revision: 1488863

URL: http://svn.apache.org/r1488863
Log:
[SYNCOPE-385] Checking null before further processing

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_1_X:r1488288-1488862

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java?rev=1488863&r1=1488862&r2=1488863&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
Mon Jun  3 07:03:07 2013
@@ -40,6 +40,7 @@ import org.apache.syncope.core.audit.Aud
 import org.apache.syncope.core.connid.ConnObjectUtil;
 import org.apache.syncope.core.init.ImplementationClassNamesLoader;
 import org.apache.syncope.core.persistence.beans.AbstractAttributable;
+import org.apache.syncope.core.persistence.beans.AbstractMappingItem;
 import org.apache.syncope.core.persistence.beans.ConnInstance;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.persistence.dao.ConnInstanceDAO;
@@ -243,11 +244,15 @@ public class ResourceController extends 
                 throw new IllegalArgumentException("Not supported for MEMBERSHIP");
         }
         if (attributable == null) {
-            throw new NotFoundException(type + " '" + id + "'");
+            throw new NotFoundException(type + " " + id );
         }
 
         final AttributableUtil attrUtil = AttributableUtil.getInstance(type);
 
+        AbstractMappingItem accountIdItem = attrUtil.getAccountIdItem(resource);
+        if (accountIdItem == null) {
+            throw new NotFoundException("AccountId mapping for " + type + " " + id + " on
resource '" + resourceName + "'");
+        }
         final String accountIdValue =
                 MappingUtil.getAccountIdValue(attributable, resource, attrUtil.getAccountIdItem(resource));
 



Mime
View raw message