I introduced regression in https://github.com/gatsbyjs/gatsby/pull/34225 for cases when
undefined. This adds just check wether nested properties are defined.
Proper error handling is below, but we still want to potentially check for
webpackCompilationHash before that (to potentially reload instead of just throwing error)