decaporg / decaporg/decap-cms

Validate received values in widgets to avoid crashes

Open
#3,524 2 comments 0 reactions 0 assignees View on GitHub
pinned type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.