Skip to content

Commit

Permalink
BUGFIX: Ensure array before setByIDList()
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed May 18, 2016
1 parent 97f3255 commit d2944d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/FileAttachmentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d2944d8

Please sign in to comment.