[react] chore: Guard against undefined settings
This commit is contained in:
parent
5e5edd9d29
commit
663528fa36
17 changed files with 79 additions and 66 deletions
|
@ -111,7 +111,8 @@ export function menuDesignOptionsStructure(design, options, settings, asFullList
|
|||
* Since these structures can be nested with option groups, this needs some extra logic
|
||||
*/
|
||||
export function getOptionStructure(option, Design, state) {
|
||||
const structure = menuDesignOptionsStructure(Design.patternConfig.options, state.settings)
|
||||
const { settings = {} } = state // Guard against undefined settings
|
||||
const structure = menuDesignOptionsStructure(Design.patternConfig.options, settings)
|
||||
|
||||
return findOption(structure, option)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue