Skip to content

Commit 54c8df4

Browse files
defuncarthaarts
authored andcommitted
Add check to ensure out of bounds not possible.
1 parent cc0c86d commit 54c8df4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/printers/pretty_printer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class PrettyPrinter extends LogPrinter {
133133

134134
String? formatStackTrace(StackTrace? stackTrace, int methodCount) {
135135
var lines = stackTrace.toString().split('\n');
136-
if (stackTraceBeginIndex > 0) {
136+
if (stackTraceBeginIndex > 0 && stackTraceBeginIndex < lines.length - 1) {
137137
lines = lines.sublist(stackTraceBeginIndex);
138138
}
139139
var formatted = <String>[];

0 commit comments

Comments
 (0)