Skip to content

Commit

Permalink
Check is paste handler a function only if it exists (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
gohabereg authored Jul 25, 2018
1 parent 07eb1b7 commit dfb35da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/codex-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16116,7 +16116,7 @@ var Paste = function (_Module) {
if (_this.config.initialBlock === name && !toolPasteConfig.handler) {
_.log('\xAB' + name + '\xBB Tool must provide a paste handler.', 'warn');
}
if (typeof toolPasteConfig.handler !== 'function') {
if (toolPasteConfig.handler && typeof toolPasteConfig.handler !== 'function') {
_.log('Paste handler for \xAB' + name + '\xBB Tool should be a function.', 'warn');
} else {
var tags = toolPasteConfig.tags || [];
Expand Down
2 changes: 1 addition & 1 deletion build/codex-editor.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/modules/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class Paste extends Module {
);
}

if (typeof toolPasteConfig.handler !== 'function') {
if (toolPasteConfig.handler && typeof toolPasteConfig.handler !== 'function') {
_.log(
`Paste handler for «${name}» Tool should be a function.`,
'warn',
Expand Down

0 comments on commit dfb35da

Please sign in to comment.