[react] chore: Guard against undefined settings
This commit is contained in:
parent
5e5edd9d29
commit
663528fa36
17 changed files with 79 additions and 66 deletions
|
@ -157,6 +157,7 @@ export const Editor = ({
|
|||
* @param (object) props.config - The editor config
|
||||
*/
|
||||
const viewfinder = ({ design, designs, state, config }) => {
|
||||
const { settings = {} } = state // Guard against undefined settings
|
||||
/*
|
||||
* Grab Design from props or state and make them extra props
|
||||
*/
|
||||
|
@ -174,7 +175,7 @@ const viewfinder = ({ design, designs, state, config }) => {
|
|||
*/
|
||||
const [measurementsOk, missingMeasurements] = hasRequiredMeasurements(
|
||||
designs[design],
|
||||
state.settings?.measurements
|
||||
settings.measurements
|
||||
)
|
||||
if (missingMeasurements) extraProps.missingMeasurements = missingMeasurements
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue