8199547: Exception to Pattern Syntax

Reviewed-by: rriggs
This commit is contained in:
Xueming Shen 2018-03-15 16:04:30 -07:00
parent 3a7104760a
commit 087ea6befb

View File

@ -106,7 +106,7 @@ public class PatternSyntaxException
}
sb.append(System.lineSeparator());
sb.append(pattern);
if (index >= 0) {
if (index >= 0 && pattern != null && index < pattern.length()) {
sb.append(System.lineSeparator());
for (int i = 0; i < index; i++) sb.append(' ');
sb.append('^');