File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,13 @@ export function parseSemver(input: string): SemVer {
147
147
* @param linesOfContext number of context lines we want to add pre/post
148
148
*/
149
149
export function addContextToFrame ( lines : string [ ] , frame : StackFrame , linesOfContext : number = 5 ) : void {
150
- const lineno = frame . lineno || 0 ;
150
+ // When there is no line number in the frame, attaching context is nonsensical and will even break grouping
151
+ if ( frame . lineno === undefined ) {
152
+ return ;
153
+ }
154
+
151
155
const maxLines = lines . length ;
152
- const sourceLine = Math . max ( Math . min ( maxLines , lineno - 1 ) , 0 ) ;
156
+ const sourceLine = Math . max ( Math . min ( maxLines , frame . lineno - 1 ) , 0 ) ;
153
157
154
158
frame . pre_context = lines
155
159
. slice ( Math . max ( 0 , sourceLine - linesOfContext ) , sourceLine )
You can’t perform that action at this time.
0 commit comments