Skip to content

Commit

Permalink
MINOR: Fixed FileField->Value() erroring when files value not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshort committed Dec 26, 2011
1 parent 3478e4f commit d692c22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions forms/FileField.php
Expand Up @@ -156,11 +156,11 @@ public function saveInto(DataObject $record) {
$record->{$this->name . 'ID'} = $file->ID;
}
}

public function Value() {
return $_FILES[$this->getName()];
return isset($_FILES[$this->getName()]) ? $_FILES[$this->getName()] : null;
}

/**
* Get custom validator for this field
*
Expand Down

0 comments on commit d692c22

Please sign in to comment.