velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r538803 - /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java
Date Thu, 17 May 2007 04:43:30 GMT
Author: nbubna
Date: Wed May 16 21:43:29 2007
New Revision: 538803

URL: http://svn.apache.org/viewvc?view=rev&rev=538803
Log:
fix NPE when a tool has global properties but no local properties

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java?view=diff&rev=538803&r1=538802&r2=538803
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolboxFactory.java
Wed May 16 21:43:29 2007
@@ -206,9 +206,16 @@
         Map properties = scopedProperties.get(scope);
 
         Toolbox toolbox;
-        if (properties == null && globalProperties == null)
+        if (properties == null)
         {
-            toolbox = new Toolbox(tools);
+            if (globalProperties == null)
+            {
+                toolbox = new Toolbox(tools);
+            }
+            else
+            {
+                toolbox = new Toolbox(tools, globalProperties);
+            }
         }
         else
         {



Mime
View raw message