Skip to content

Commit 3fc1bc6

Browse files
authored
[devtools] fix: support optionality of structured stack trace function name (#33697)
Follow-up to #33680. Turns out `.getFunctionName` not always returns string.
1 parent ef8b6fa commit 3fc1bc6

File tree

1 file changed

+3
-2
lines changed
  • packages/react-devtools-shared/src/backend/utils

1 file changed

+3
-2
lines changed

packages/react-devtools-shared/src/backend/utils/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ function collectStackTrace(
360360
const callSite = structuredStackTrace[i];
361361
const name = callSite.getFunctionName();
362362
if (
363-
name.includes('react_stack_bottom_frame') ||
364-
name.includes('react-stack-bottom-frame')
363+
name != null &&
364+
(name.includes('react_stack_bottom_frame') ||
365+
name.includes('react-stack-bottom-frame'))
365366
) {
366367
// We pick the last frame that matches before the bottom frame since
367368
// that will be immediately inside the component as opposed to some helper.

0 commit comments

Comments
 (0)