diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index 5421edc8b1a..6eef8d89885 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -267,7 +267,7 @@ public function ItemEditForm() $form->makeReadonly(); // Hack to re-enable delete button if user can delete if ($this->record->hasMethod('canDelete') && $this->record->canDelete()) { - $form->Actions()->fieldByName('action_doDelete')->setReadonly(false); + $form->Actions()->fieldByName('action_doDelete')?->setReadonly(false); } } elseif (!$this->record->ID && (!$this->record->hasMethod('canCreate') || !$this->record->canCreate(null, $this->getCreateContext()))