File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/react-devtools-shared/src/backend/utils Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ function collectStackTrace(
381381 // $FlowFixMe[prop-missing]
382382 typeof callSite . getEnclosingColumnNumber === 'function'
383383 ? ( callSite : any ) . getEnclosingColumnNumber ( )
384- : callSite . getLineNumber ( ) ;
384+ : callSite . getColumnNumber ( ) ;
385385 if ( ! sourceURL || ! line || ! col ) {
386386 // Skip eval etc. without source url. They don't have location.
387387 continue ;
@@ -412,12 +412,18 @@ export function parseSourceFromOwnerStack(error: Error): Source | null {
412412 let stack ;
413413 try {
414414 stack = error . stack ;
415+ } catch ( e ) {
416+ Error . prepareStackTrace = undefined ;
417+ stack = error . stack ;
415418 } finally {
416419 Error . prepareStackTrace = previousPrepare ;
417420 }
418421 if ( collectedLocation !== null ) {
419422 return collectedLocation ;
420423 }
424+ if ( stack == null ) {
425+ return null ;
426+ }
421427 // Fallback to parsing the string form.
422428 const componentStack = formatOwnerStackString ( stack ) ;
423429 return parseSourceFromComponentStack ( componentStack ) ;
You can’t perform that action at this time.
0 commit comments