incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1407408 - /sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
Date Fri, 09 Nov 2012 10:14:28 GMT
Author: cziegeler
Date: Fri Nov  9 10:14:28 2012
New Revision: 1407408

URL: http://svn.apache.org/viewvc?rev=1407408&view=rev
Log:
SLING-2530 : Implement CRUD based on resources

Modified:
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1407408&r1=1407407&r2=1407408&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
Fri Nov  9 10:14:28 2012
@@ -1015,6 +1015,11 @@ public class ResourceResolverImpl extend
      */
     public void delete(final Resource resource)
             throws PersistenceException {
+        // check if the resource is non existing - throws NPE if resource is null as stated
in the API
+        if ( ResourceUtil.isNonExistingResource(resource) ) {
+            // nothing to do
+            return;
+        }
         // if resource is null, we get an NPE as stated in the API
         final String path = resource.getPath();
         final ModifyingResourceProvider mrp = this.factory.getRootProviderEntry().getModifyingProvider(this.context,



Mime
View raw message