Skip to content

Commit

Permalink
Fix: Prevent crash when the custom field's value is null.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgsy authored Sep 20, 2024
1 parent ccd0805 commit 76741c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.0.2 (September 20, 2024)

### Release highlights

This is a patch release that resolves an issue that resulted in a crash after removing the content from the editor. The issue was caused by the fact that after releasing Strapi 5.0.0, the custom field's `value` property becomes `null` when the editor is empty.

Check out the highlights of the original v1.0.0 release.

### Bug fixes
* Prevent passing `null` as the editor data to prevent the crash.

## 1.0.1 (September 19, 2024)

### Release highlights
Expand Down
3 changes: 1 addition & 2 deletions admin/src/components/CKEditorInput/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const CKEditorInput = ( props ) => {
<CKEditor
editor={ ClassicEditor }
disabled={ disabled }
data={ value }
data={ value ?? '' }
onReady={ ( editor ) => {
const wordCountPlugin = editor.plugins.get( 'WordCount' );
const wordCountWrapper = wordCounter.current;
Expand All @@ -89,7 +89,6 @@ const CKEditorInput = ( props ) => {
}}
onChange={ ( event, editor ) => {
const data = editor.getData();

onChange( { target: { name, value: data } } );

const wordCountPlugin = editor.plugins.get( 'WordCount' );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ckeditor/strapi-plugin-ckeditor",
"version": "1.0.1",
"version": "1.0.2",
"description": "CKEditor 5 - Official Integration for Strapi",
"strapi": {
"name": "ckeditor",
Expand Down

0 comments on commit 76741c5

Please sign in to comment.