Skip to content

Commit

Permalink
Make calendar block resilient against editor module not being present (
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Jun 14, 2019
1 parent 171c99e commit 4f5b472
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-library/src/calendar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ class CalendarEdit extends Component {
}

export default withSelect( ( select ) => {
const coreEditorSelect = select( 'core/editor' );
if ( ! coreEditorSelect ) {
return;
}
const {
getEditedPostAttribute,
} = select( 'core/editor' );
} = coreEditorSelect;
const postType = getEditedPostAttribute( 'type' );
// Dates are used to overwrite year and month used on the calendar.
// This overwrite should only happen for 'post' post types.
Expand Down

0 comments on commit 4f5b472

Please sign in to comment.