svn commit: r1304200 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1304200 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java

jleroux@apache.org
Author: jleroux
Date: Fri Mar 23 06:26:22 2012
New Revision: 1304200

URL: http://svn.apache.org/viewvc?rev=1304200&view=rev
Log:
A patch from Kiran Gawde  "StringIndexOutOfBoundsException in OfbizContentTransform" https://issues.apache.org/jira/browse/OFBIZ-4464

Fixes this bug:
---- exception report ----------------------------------------------------------
Error in request handler:
Exception: org.ofbiz.widget.screen.ScreenRenderException
Message: Error rendering screen component://ecommerce/widget/CommonScreens.xml#main-decorator: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 (String index out of range: 0)
---- cause ---------------------------------------------------------------------
Exception: java.lang.StringIndexOutOfBoundsException
Message: String index out of range: 0
---- stack trace ---------------------------------------------------------------
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
java.lang.String.charAt(String.java:686)
org.ofbiz.webapp.ftl.OfbizContentTransform$1.close(OfbizContentTransform.java:97)

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java?rev=1304200&r1=1304199&r2=1304200&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java Fri Mar 23 06:26:22 2012
@@ -102,7 +102,8 @@ public class OfbizContentTransform imple
                     // make the link
                     StringBuilder newURL = new StringBuilder();
                     ContentUrlTag.appendContentPrefix(request, newURL);
-                    if (newURL.length() > 0 && newURL.charAt(newURL.length() - 1) != '/' && requestUrl.charAt(0) != '/') {
+                    if ((newURL.length() > 0 && newURL.charAt(newURL.length() - 1) != '/')
+                     && (requestUrl.length()> 0 && requestUrl.charAt(0) != '/')) {
                         newURL.append('/');
                     }