Skip to content

Commit 12320f6

Browse files
Make sure currMenuItem isn't null
Former-commit-id: b2f2df1
1 parent 5252d5e commit 12320f6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

content/cookie-settings.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
visible: false
3-
isVersioned: false
43
---
54

65
### Cookie settings

pages/[...slug].js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function Article({
140140
});
141141

142142
// If version wasn't specified by hand in the URL, remove version from URL of unversioned pages.
143-
if (currMenuItem.isVersioned) {
143+
if (currMenuItem && currMenuItem.isVersioned) {
144144
if (
145145
versionFromStaticLoad == DEFAULT_VERSION &&
146146
platformFromStaticLoad == DEFAULT_PLATFORM
@@ -228,6 +228,7 @@ export default function Article({
228228
// Not a latest version within the current platform
229229
version != DEFAULT_VERSION &&
230230
version != maxVersion &&
231+
currMenuItem &&
231232
currMenuItem.isVersioned
232233
) {
233234
// Link to latest version within the current platform
@@ -251,6 +252,7 @@ export default function Article({
251252
// Latest within the current (not OSS) platform
252253
(version == DEFAULT_VERSION || version == maxVersion) &&
253254
platform != DEFAULT_PLATFORM &&
255+
currMenuItem &&
254256
currMenuItem.isVersioned
255257
) {
256258
// Link to latest OSS version

0 commit comments

Comments
 (0)