svn commit: r1304201 - in /ofbiz/branches/release10.04: ./ 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: r1304201 - in /ofbiz/branches/release10.04: ./ framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java

jleroux@apache.org
Author: jleroux
Date: Fri Mar 23 06:27:41 2012
New Revision: 1304201

URL: http://svn.apache.org/viewvc?rev=1304201&view=rev
Log:
"Applied fix from trunk for revision: 1304200  "
------------------------------------------------------------------------
r1304200 | jleroux | 2012-03-23 07:26:22 +0100 (ven., 23 mars 2012) | 15 lines

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/branches/release10.04/   (props changed)
    ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java

Propchange: ofbiz/branches/release10.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1304200

Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java?rev=1304201&r1=1304200&r2=1304201&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java (original)
+++ ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java Fri Mar 23 06:27:41 2012
@@ -64,7 +64,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('/');
                     }
                     newURL.append(requestUrl);