Better handle undefined Error stacks in DevTools error boundary (#24065)
Brian Vaughn committed
Mar 10, 2022 at 10:36 UTC
4a87fb52115ca26b2251bdcc94deeff841b66e52
1 file changed
+3
-3
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js
+3
-3
@@ -49,16 +49,16 @@ export default class ErrorBoundary extends Component<Props, State> {
49
const errorMessage =
50
typeof error === 'object' &&
51
error !== null &&
52
- error.hasOwnProperty('message')
52
+ typeof error.message === 'string'
53
? error.message
54
- : String(error);
54
+ : null;
55
56
const isTimeout = error instanceof TimeoutError;
57
58
const callStack =
59
typeof error === 'object' &&
60
error !== null &&
61
- error.hasOwnProperty('stack')
61
+ typeof error.stack === 'string'
62
? error.stack
63
.split('\n')
64
.slice(1)