Skip to content

Commit fde00b1

Browse files
Brian Vaughnzhengjitf
authored andcommitted
Better handle undefined Error stacks in DevTools error boundary (facebook#24065)
1 parent 3deabd4 commit fde00b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ export default class ErrorBoundary extends Component<Props, State> {
4949
const errorMessage =
5050
typeof error === 'object' &&
5151
error !== null &&
52-
error.hasOwnProperty('message')
52+
typeof error.message === 'string'
5353
? error.message
54-
: String(error);
54+
: null;
5555

5656
const isTimeout = error instanceof TimeoutError;
5757

5858
const callStack =
5959
typeof error === 'object' &&
6060
error !== null &&
61-
error.hasOwnProperty('stack')
61+
typeof error.stack === 'string'
6262
? error.stack
6363
.split('\n')
6464
.slice(1)

0 commit comments

Comments
 (0)