Skip to content

Commit 4b38c0e

Browse files
committed
fix: Don't hard fail when block is missing
1 parent 00c4627 commit 4b38c0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import './styles.less';
2121
export const applyStyleWrapperToBlock = (blockConfig) => {
2222
const BaseEditComponent = blockConfig.edit;
2323
let EditComponent = BaseEditComponent;
24-
if (!EditComponent._styleWrapped) {
24+
if (EditComponent && !EditComponent._styleWrapped) {
2525
EditComponent = (props) => (
2626
<BlockStyleWrapperEdit {...props}>
2727
<BaseEditComponent {...props} />
@@ -33,7 +33,7 @@ export const applyStyleWrapperToBlock = (blockConfig) => {
3333

3434
const BaseViewComponent = blockConfig.view;
3535
let ViewComponent = BaseViewComponent;
36-
if (!ViewComponent._styleWrapped) {
36+
if (ViewComponent && !ViewComponent._styleWrapped) {
3737
ViewComponent = (props) => (
3838
<BlockStyleWrapperView {...props}>
3939
<BaseViewComponent {...props} />

0 commit comments

Comments
 (0)