From adca1e7150768f913eca6732ec0479e1acb085bd Mon Sep 17 00:00:00 2001 From: Dhenain Ambroise Date: Wed, 3 Jun 2020 15:13:20 +0200 Subject: [PATCH] Fix "TypeError: Cannot destructure property 'message' of 'error' as it is undefined." --- src/components/errors/ErrorDebug.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/errors/ErrorDebug.tsx b/src/components/errors/ErrorDebug.tsx index 7a5fa67e5..9417da6b5 100644 --- a/src/components/errors/ErrorDebug.tsx +++ b/src/components/errors/ErrorDebug.tsx @@ -15,8 +15,8 @@ type Props = { * @param props */ const ErrorDebug = (props: Props): JSX.Element => { - const { error, context }: Props = props; - const { message, stack } = error; + const { error, context }: Props = props || {}; + const { message, stack } = error || {}; let stringifiedContext; try {