From 51ef9a8d1d71a3dccbfbc08ecde77b3db9d7162c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20P=C3=B6hler?= Date: Sat, 27 Dec 2025 13:19:01 +0100 Subject: [PATCH] fix: early return added to prevent null reference errors on getData call when editor is not initialized yet --- src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 266563a3..d1f9d486 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -52,6 +52,10 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; } getData() { + if (!this.editor) { + return ''; + } + const notTrimmedData = this.editor.getData({ trim: 'none' }); const isDataEmpty = notTrimmedData === '

 

';