You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2011/03/14 14:01:42 UTC

svn commit: r1081355 - /click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java

Author: sabob
Date: Mon Mar 14 13:01:41 2011
New Revision: 1081355

URL: http://svn.apache.org/viewvc?rev=1081355&view=rev
Log:
fix potential IndexOutOfBoundsException

Modified:
    click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java

Modified: click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java?rev=1081355&r1=1081354&r2=1081355&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java (original)
+++ click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java Mon Mar 14 13:01:41 2011
@@ -414,10 +414,13 @@ public class ErrorReport {
         if (isParseError()) {
             String message = error.getMessage();
 
+            String parseMsg = message;
             int startIndex = message.indexOf('\n');
             int endIndex = message.lastIndexOf("...");
 
-            String parseMsg = message.substring(startIndex + 1, endIndex);
+            if (startIndex != -1 && endIndex > startIndex) {
+                parseMsg = message.substring(startIndex + 1, endIndex);
+            }
 
             parseMsg = ClickUtils.escapeHtml(parseMsg);