Skip to content

Commit 2f1e8eb

Browse files
committed
fix: 修复脚本报错问题
1 parent f91af93 commit 2f1e8eb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../../js/summernote-bs5.min.js'
1+
import '../../js/summernote-bs5.min.js'
22
import { addLink, addScript } from '../../../BootstrapBlazor/modules/utility.js'
33
import Data from '../../../BootstrapBlazor/modules/data.js'
44
import EventHandler from '../../../BootstrapBlazor/modules/event-handler.js'
@@ -175,7 +175,11 @@ export function getCode(id) {
175175
}
176176

177177
export function reset(id) {
178-
const editor = Data.get(id)
178+
const editor = Data.get(id);
179+
if (!editor.$editor) {
180+
return;
181+
}
182+
179183
const context = editor.$editor.data('summernote')
180184

181185
const showSubmit = editor.el.getAttribute("data-bb-submit") === "true"

0 commit comments

Comments
 (0)