Skip to content

Commit

Permalink
[sitecore-jss] Handle layout for null items (#1492)
Browse files Browse the repository at this point in the history
* handle null values

* update changelog
  • Loading branch information
addy-pathania authored May 19, 2023
1 parent 8522677 commit a617a49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Our versioning strategy is as follows:
* `[sitecore-jss-nextjs] Add a new handling for token $siteLang(context site language) in middleware redirect ([#1454](https://github.com/Sitecore/jss/pull/1454))
* `[sitecore-jss]` `[templates/nextjs-sxa]` Rewrite logic of handling custom error pages. The error pages rewrite page with error(it's saving status code) instead of redirected ([#1469](https://github.com/Sitecore/jss/pull/1469)) ([#1476](https://github.com/Sitecore/jss/pull/1476))
* `[templates/nextjs]` Remove .babelrc to (re)enable SWC compilation by default ([#1483](https://github.com/Sitecore/jss/pull/1483))
* `[sitecore-jss]` Handle null items in graphql layout service. ([#1492](https://github.com/Sitecore/jss/pull/1492))

### 🧹 Chores

Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss/src/layout/graphql-layout-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class GraphQLLayoutService extends LayoutServiceBase {

// If `rendered` is empty -> not found
return (
data?.layout?.item.rendered || {
data?.layout?.item?.rendered || {
sitecore: { context: { pageEditing: false, language }, route: null },
}
);
Expand Down

0 comments on commit a617a49

Please sign in to comment.