DEV: Ensure helper or post exist before decorations (#27)

This commit is contained in:
Keegan George 2022-09-20 18:23:22 -07:00 committed by GitHub
parent c95026fde0
commit 2896c69a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -73,6 +73,9 @@ export default apiInitializer("0.11.1", (api) => {
api.decorateCookedElement( api.decorateCookedElement(
(post, helper) => { (post, helper) => {
if (!helper || !post) {
return;
}
const canEdit = helper.widget.attrs.canEdit; const canEdit = helper.widget.attrs.canEdit;
if (!canEdit) { if (!canEdit) {