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
This commit is contained in:
Jessica Chowdhury
2024-07-23 17:36:16 +01:00
committed by GitHub
parent b3e8ddf302
commit f2b3305cb0

View File

@@ -119,8 +119,8 @@ export const VersionView: EditViewComponent = async (props) => {
doc={doc}
docPermissions={docPermissions}
initialComparisonDoc={latestVersion}
latestDraftVersion={latestDraftVersion.id}
latestPublishedVersion={latestPublishedVersion.id}
latestDraftVersion={latestDraftVersion?.id}
latestPublishedVersion={latestPublishedVersion?.id}
localeOptions={localeOptions}
versionID={versionID}
/>