Skip to content

Commit

Permalink
fix: #301 (#302)
Browse files Browse the repository at this point in the history
* fix: Cannot read properties of undefined (reading 'line-table') #301

* fix: Cannot read properties of undefined (reading 'line-table') #301
  • Loading branch information
ThinkHalo authored and lyngai committed Aug 16, 2022
1 parent 72e46c9 commit f8bae8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Cherry.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default class Cherry extends CherryStatic {
this.switchModel(this.options.editor.defaultModel);

this.cherryDomResize();

Event.on(this.instanceId, Event.Events.toolbarHide, () => {
this.status.toolbar = 'hide';
});
Expand Down
2 changes: 1 addition & 1 deletion src/toolbars/HookCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class HookCenter {
if (HookList[name]) {
this.allMenusName.push(name);
this.hooks[name] = new HookList[name]($cherry);
} else if (customMenu[name]) {
} else if (customMenu !== undefined && customMenu !== null && customMenu[name]) {
this.allMenusName.push(name);
// 如果是自定义菜单,传参兼容旧版
this.hooks[name] = new customMenu[name]($cherry.editor, $cherry.engine, $cherry.toolbar, $cherry);
Expand Down

0 comments on commit f8bae8b

Please sign in to comment.