From 30a147d8d2173b11e75c21ec3c17439060a949f0 Mon Sep 17 00:00:00 2001 From: Chuang Yu Date: Wed, 22 Mar 2017 18:37:04 +0800 Subject: [PATCH] fix: fix scriptbutton error --- plugins/basicstyles/plugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/basicstyles/plugin.js b/plugins/basicstyles/plugin.js index 41bacae33fb..c0bee811ee0 100644 --- a/plugins/basicstyles/plugin.js +++ b/plugins/basicstyles/plugin.js @@ -131,6 +131,9 @@ CKEDITOR.plugins.add( 'basicstyles', { var el = editor.getSelection().getStartElement(); var btn = editor.ui.get(toolbarName); + if (!btn) { + return + } var element = CKEDITOR.document.getById(btn._.id); var span = element.find('.cke_button_icon').getItem(0); var arrow = element.find('.cke_button_arrow').getItem(0);