Skip to content

Commit 76741c5

Browse files
authored
Fix: Prevent crash when the custom field's value is null.
1 parent ccd0805 commit 76741c5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 1.0.2 (September 20, 2024)
4+
5+
### Release highlights
6+
7+
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.
8+
9+
Check out the highlights of the original v1.0.0 release.
10+
11+
### Bug fixes
12+
* Prevent passing `null` as the editor data to prevent the crash.
13+
314
## 1.0.1 (September 19, 2024)
415

516
### Release highlights

admin/src/components/CKEditorInput/index.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const CKEditorInput = ( props ) => {
7676
<CKEditor
7777
editor={ ClassicEditor }
7878
disabled={ disabled }
79-
data={ value }
79+
data={ value ?? '' }
8080
onReady={ ( editor ) => {
8181
const wordCountPlugin = editor.plugins.get( 'WordCount' );
8282
const wordCountWrapper = wordCounter.current;
@@ -89,7 +89,6 @@ const CKEditorInput = ( props ) => {
8989
}}
9090
onChange={ ( event, editor ) => {
9191
const data = editor.getData();
92-
9392
onChange( { target: { name, value: data } } );
9493

9594
const wordCountPlugin = editor.plugins.get( 'WordCount' );

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ckeditor/strapi-plugin-ckeditor",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "CKEditor 5 - Official Integration for Strapi",
55
"strapi": {
66
"name": "ckeditor",

0 commit comments

Comments
 (0)