diff --git a/src/FileAttachmentField.php b/src/FileAttachmentField.php index ddea293..5725ce8 100644 --- a/src/FileAttachmentField.php +++ b/src/FileAttachmentField.php @@ -1298,7 +1298,7 @@ public function getFileClass($filename = null) $name = $this->getName(); $record = $this->getRecord(); - $ext = pathinfo($filename, PATHINFO_EXTENSION); + $ext = pathinfo($filename ?? '', PATHINFO_EXTENSION); $defaultClass = File::get_class_for_file_extension($ext); if(empty($name) || empty($record)) {