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 {
147147 * @param linesOfContext number of context lines we want to add pre/post
148148 */
149149export 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+
151155 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 ) ;
153157
154158 frame . pre_context = lines
155159 . slice ( Math . max ( 0 , sourceLine - linesOfContext ) , sourceLine )
You can’t perform that action at this time.
0 commit comments