Skip to content

Commit

Permalink
Fix unit tests (Block Switcher without blocks)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 27, 2018
1 parent 8c0db3a commit d720cab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export class BlockSwitcher extends Component {
render() {
const { blocks, onTransform, isLocked } = this.props;
const { hoveredClassName } = this.state;

if ( ! blocks || ! blocks.length ) {
return null;
}

const allowedBlocks = getPossibleBlockTransformations( blocks );
const sourceBlockName = blocks[ 0 ].name;
const blockType = getBlockType( sourceBlockName );
Expand Down

0 comments on commit d720cab

Please sign in to comment.