Skip to content

Commit

Permalink
BUGFIX: Don’t crash on unset focus keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Mar 25, 2019
1 parent 0af683b commit ab5ba70
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Resources/Private/Scripts/YoastInfoView/src/YoastInfoView.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class YoastInfoView extends PureComponent {

this.state = {
nodeUri: $get('uri', documentNode),
focusKeyword: $get('properties.focusKeyword', documentNode),
focusKeyword: $get('properties.focusKeyword', documentNode) || '',
isCornerstone: $get('properties.isCornerstone', documentNode),
isAnalyzing: false,
page: {
Expand Down Expand Up @@ -112,7 +112,7 @@ export default class YoastInfoView extends PureComponent {
const documentNode = getNodeByContextPath(documentNodePath);
this.setState({
nodeUri: $get('uri', documentNode),
focusKeyword: $get('properties.focusKeyword', documentNode),
focusKeyword: $get('properties.focusKeyword', documentNode) || '',
isCornerstone: $get('properties.isCornerstone', documentNode),
}, this.fetchContent);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class NeosYoastApp extends PureComponent {
description: this.props.description || '',
slug: this.props.uriPathSegment,
url: this.props.pageUrl,
focusKeyword: this.props.focusKeyword,
focusKeyword: this.props.focusKeyword || '',
},
page: {
titleTemplate: '{title}',
Expand Down Expand Up @@ -319,7 +319,7 @@ export default class NeosYoastApp extends PureComponent {
data: this.state.editorData,
baseUrl: this.props.baseUrl,
locale: this.props.uiLocale,
keyword: this.props.focusKeyword,
keyword: this.state.editorData.focusKeyword,
breadcrumbs: this.props.breadcrumbs,
isAmp: this.props.isAmp,
hasPaperStyle: false,
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Assets/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/YoastInfoView/Plugin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/YoastInfoView/Plugin.js.map

Large diffs are not rendered by default.

0 comments on commit ab5ba70

Please sign in to comment.