click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1081355 - /click/trunk/click/framework/src/org/apache/click/util/ErrorReport.java
Date Mon, 14 Mar 2011 13:01:42 GMT
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);
 



Mime
View raw message