Skip to content

Commit

Permalink
fix: Don't hard fail when block is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Apr 22, 2024
1 parent 00c4627 commit 4b38c0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import './styles.less';
export const applyStyleWrapperToBlock = (blockConfig) => {
const BaseEditComponent = blockConfig.edit;
let EditComponent = BaseEditComponent;
if (!EditComponent._styleWrapped) {
if (EditComponent && !EditComponent._styleWrapped) {
EditComponent = (props) => (
<BlockStyleWrapperEdit {...props}>
<BaseEditComponent {...props} />
Expand All @@ -33,7 +33,7 @@ export const applyStyleWrapperToBlock = (blockConfig) => {

const BaseViewComponent = blockConfig.view;
let ViewComponent = BaseViewComponent;
if (!ViewComponent._styleWrapped) {
if (ViewComponent && !ViewComponent._styleWrapped) {
ViewComponent = (props) => (
<BlockStyleWrapperView {...props}>
<BaseViewComponent {...props} />
Expand Down

0 comments on commit 4b38c0e

Please sign in to comment.