Skip to content

Validate received values in widgets to avoid crashes #3524

@erquhart

Description

@erquhart

Describe the bug

Some widgets throw when they receive an unexpected value, which causes the entire editor to error out.

To Reproduce

  • Create a raw content file to edit in the CMS
  • In the file frontmatter (or in the general file if it's a data file) include a property with a string value
  • Configure the CMS to edit this property with a list widget
  • Load the entry

Expected behavior

The CMS shouldn't crash.

Additional context

Related to #3509

This strategy should apply to both widget control components and preview components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pinnedtype: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions