Skip to content

Commit f2b3305

Browse files
authored
fix: first version doc throws error (#7314)
## Description The first version document throws an error because `latestPublished` and `latestDraft` are undefined. - [X] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [X] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [X] Existing test suite passes locally with my changes
1 parent b3e8ddf commit f2b3305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next/src/views/Version/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export const VersionView: EditViewComponent = async (props) => {
119119
doc={doc}
120120
docPermissions={docPermissions}
121121
initialComparisonDoc={latestVersion}
122-
latestDraftVersion={latestDraftVersion.id}
123-
latestPublishedVersion={latestPublishedVersion.id}
122+
latestDraftVersion={latestDraftVersion?.id}
123+
latestPublishedVersion={latestPublishedVersion?.id}
124124
localeOptions={localeOptions}
125125
versionID={versionID}
126126
/>

0 commit comments

Comments
 (0)