Skip to content

Commit 81d5d93

Browse files
author
SilinMykola
committed
1128 fix bug with index
1 parent 340305e commit 81d5d93

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/com/magento/idea/magento2plugin/project/diagnostic/github/GitHubNewIssueBodyBuilderUtil.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static String buildNewBugReportBody(
4242
final @NotNull String stackTrace,
4343
final int maxAllowedBodyLength
4444
) {
45-
final int maxAllowedStackTraceLength = getMaxAllowedStackTraceLength(
45+
int maxAllowedStackTraceLength = getMaxAllowedStackTraceLength(
4646
project,
4747
bugDescription,
4848
maxAllowedBodyLength
@@ -56,6 +56,9 @@ public static String buildNewBugReportBody(
5656
String encodedCutStackTrace = "";
5757

5858
while (!isFound) {
59+
if (stackTrace.length() < maxAllowedStackTraceLength) {
60+
maxAllowedStackTraceLength = stackTrace.length();
61+
}
5962
final String cutStackTrace = stackTrace.substring(0, maxAllowedStackTraceLength - step);
6063
encodedCutStackTrace = encode(cutStackTrace);
6164

@@ -64,11 +67,6 @@ public static String buildNewBugReportBody(
6467
} else {
6568
step += 10;
6669
}
67-
final int index = maxAllowedStackTraceLength - step;
68-
69-
if (index > stackTrace.length() || index - step < 0) {
70-
isFound = true;
71-
}
7270
}
7371

7472
return buildTemplate(project, bugDescription, decode(encodedCutStackTrace));

0 commit comments

Comments
 (0)