sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r654204 - /incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java
Date Wed, 07 May 2008 18:43:08 GMT
Author: fmeschbe
Date: Wed May  7 11:43:07 2008
New Revision: 654204

URL: http://svn.apache.org/viewvc?rev=654204&view=rev
Log:
SLING-433 Prevent currentNode from being set if null

Modified:
    incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java

Modified: incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java?rev=654204&r1=654203&r2=654204&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java
(original)
+++ incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/DefaultSlingScript.java
Wed May  7 11:43:07 2008
@@ -418,7 +418,12 @@
             bindings.put(RESPONSE, sling.getResponse());
             bindings.put(RESOURCE, sling.getRequest().getResource());
             bindings.put(OUT, sling.getResponse().getWriter());
-            bindings.put(NODE, sling.getRequest().getResource().adaptTo(Node.class));
+            
+            // set the current node if the resource is node based
+            Node node = sling.getRequest().getResource().adaptTo(Node.class);
+            if (node != null) {
+                bindings.put(NODE, node);
+            }
         }
 
         Object logObject = slingBindings.get(LOG);



Mime
View raw message