Fixed error when opening meta/facebook/twitter settings with a new post

no issue
- `post.scratch` does not exist until post contents have been edited which meant that the `seoDescription` CP was erroring trying to access a non-existent `cards` property
This commit is contained in:
Kevin Ansfield 2019-03-12 12:13:32 +00:00
parent 612cbc034f
commit c28d024fec

View File

@ -52,7 +52,7 @@ export default Component.extend(SettingsMenuMixin, {
seoDescription: computed('post.scratch', 'metaDescriptionScratch', function () {
let metaDescription = this.metaDescriptionScratch || '';
let mobiledoc = this.get('post.scratch');
let [markdownCard] = mobiledoc.cards;
let [markdownCard] = (mobiledoc && mobiledoc.cards) || [];
let markdown = markdownCard && markdownCard[1] && markdownCard[1].markdown;
let placeholder;