This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
catch errors when encoding entity map
Summary: We've had several reports of people's content failing to save in our product. The only error message we have is this (with no callstack, unfortunately): ``` Unknown DraftEntity key: undefined. ``` I poked around in the DraftJS code, and my guess is that this is due to some character having an entity key associated with it that for whatever reason does not appear in the entity map. This diff "fixes" the issue by not throwing an error in this situation. This is definitely not as good as figuring out the root cause of the entity mismatch, but it seems reasonable for `convertFromDraftStateToRaw` to work with slightly malformed input. Reviewed By: niveditc Differential Revision: D16421104 fbshipit-source-id: a2046ad0cb166dac97187fd3c524f9c8cb4017ea
- Loading branch information
1 parent
96e7f25
commit 259d122
Showing
3 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/model/encoding/__tests__/__snapshots__/convertFromDraftStateToRaw-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters