File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/react-devtools-shared/src/backend/utils Expand file tree Collapse file tree 1 file changed +8
-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,19 @@ export function parseSourceFromOwnerStack(error: Error): Source | null {
412412 let stack ;
413413 try {
414414 stack = error . stack ;
415+ } catch ( e ) {
416+ // $FlowFixMe[incompatible-type] It does accept undefined.
417+ Error. prepareStackTrace = undefined ;
418+ stack = error . stack ;
415419 } finally {
416420 Error . prepareStackTrace = previousPrepare ;
417421 }
418422 if ( collectedLocation !== null ) {
419423 return collectedLocation ;
420424 }
425+ if ( stack == null ) {
426+ return null ;
427+ }
421428 // Fallback to parsing the string form.
422429 const componentStack = formatOwnerStackString ( stack ) ;
423430 return parseSourceFromComponentStack ( componentStack ) ;
You can’t perform that action at this time.
0 commit comments