diff --git a/code/FileAttachmentField.php b/code/FileAttachmentField.php index c08291a..60258da 100644 --- a/code/FileAttachmentField.php +++ b/code/FileAttachmentField.php @@ -210,7 +210,7 @@ public function saveInto(DataObjectInterface $record) { } } - if($relation = $this->getRelation()) { + if(($relation = $this->getRelation()) && is_array($this->Value())) { $relation->setByIDList($this->Value()); } elseif($record->has_one($fieldname)) { $record->{"{$fieldname}ID"} = $this->Value() ?: 0;