velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject svn commit: r1151923 - /velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java
Date Thu, 28 Jul 2011 16:44:21 GMT
Author: schultz
Date: Thu Jul 28 16:44:21 2011
New Revision: 1151923

URL: http://svn.apache.org/viewvc?rev=1151923&view=rev
Log:
Added null checking for 'ignoreThese' parameter.

Modified:
    velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java

Modified: velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java?rev=1151923&r1=1151922&r2=1151923&view=diff
==============================================================================
--- velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java
(original)
+++ velocity/tools/branches/2.0.x/src/main/java/org/apache/velocity/tools/view/LinkTool.java
Thu Jul 28 16:44:21 2011
@@ -168,11 +168,19 @@ public class LinkTool extends org.apache
         if (query != null && !query.isEmpty())
         {
             Set keys = query.keySet();
-            these = new Object[keys.size() + ignoreThese.length];
+
+            int size = keys.size();
+            if(null != ignoreThese)
+                size += ignoreThese.length;
+
+            these = new Object[size];
             int i = 0;
-            for (; i < ignoreThese.length; i++)
+            if(null != ignoreThese)
             {
-                these[i] = ignoreThese[i];
+                for (; i < ignoreThese.length; i++)
+                {
+                    these[i] = ignoreThese[i];
+                }
             }
             for (Iterator iter = keys.iterator(); iter.hasNext(); i++)
             {



Mime
View raw message