Browse files

MINOR: Fixed FileField->Value() erroring when files value not set.

  • Loading branch information...
1 parent 3478e4f commit d692c22ee459a2d1ebd559f252fe31f0741267de @ajshort ajshort committed Dec 26, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 forms/FileField.php
View
6 forms/FileField.php
@@ -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
*

0 comments on commit d692c22

Please sign in to comment.