Skip to content

Commit

Permalink
Fix check for error.digest
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Oct 15, 2022
1 parent 83958cb commit c0b352a
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -446,12 +446,15 @@ export default function HotReload({

const handleOnUnhandledError = useCallback((ev) => {
if (
ev?.error?.digest.startsWith('NEXT_REDIRECT') ||
ev?.error?.digest === 'NEXT_NOT_FOUND'
ev.error &&
ev.error.digest &&
(ev.error.digest.startsWith('NEXT_REDIRECT') ||
ev.error.digest === 'NEXT_NOT_FOUND')
) {
ev.preventDefault()
return
}

hadRuntimeError = true
onUnhandledError(dispatch, ev)
}, [])
Expand Down

0 comments on commit c0b352a

Please sign in to comment.