Skip to content

Commit 1434b0f

Browse files
Add null check
1 parent fbe96eb commit 1434b0f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
123123
- Added theming to the project
124124
- Created single blog post page
125125
- Connected Dev.to API with single post UI
126-
- Added Shayla to 'about us'
127126

128127
### Fixed
129128

@@ -151,10 +150,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
151150
- Added Faith to 'about us'
152151
- Updated Mariana's title in 'about us'
153152
- Updated outdated dependencies
153+
- Added Shayla to 'about us'
154154

155155
### Fixed
156156

157157
- Updated husky script to avoid warning
158+
- Resolved incorrect meta tag rendering for nested routes
158159

159160
### Changed
160161

components/layout/Meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Script from 'next/script';
55

66
export default function Meta() {
77
const currentPath = usePathname();
8-
const firstSegment = '/' + currentPath.split('/')[1];
8+
const firstSegment = '/' + currentPath.split('/')[1] || [];
99
const meta =
1010
firstSegment in pageMeta ? pageMeta[firstSegment] : pageMeta['/'];
1111
return (

0 commit comments

Comments
 (0)