fix: adds optional chaining to safely read drafts setting on versions (#577)

This commit is contained in:
Jarrod Flesch
2022-05-23 20:23:24 -04:00
committed by GitHub
parent 200aa2e1c2
commit 982b3f0582

View File

@@ -32,7 +32,7 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise<
let { data } = args;
const shouldSaveDraft = Boolean(draftArg && globalConfig.versions.drafts);
const shouldSaveDraft = Boolean(draftArg && globalConfig.versions?.drafts);
// /////////////////////////////////////
// 1. Retrieve and execute access