Skip to content
This repository
Browse code

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

  • Loading branch information...
commit d692c22ee459a2d1ebd559f252fe31f0741267de 1 parent 3478e4f
Andrew Short authored December 26, 2011

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  forms/FileField.php
6  forms/FileField.php
@@ -156,11 +156,11 @@ public function saveInto(DataObject $record) {
156 156
 			$record->{$this->name . 'ID'} = $file->ID;
157 157
 		}
158 158
 	}
159  
-	
  159
+
160 160
 	public function Value() {
161  
-		return $_FILES[$this->getName()];
  161
+		return isset($_FILES[$this->getName()]) ? $_FILES[$this->getName()] : null;
162 162
 	}
163  
-	
  163
+
164 164
 	/**
165 165
 	 * Get custom validator for this field
166 166
 	 * 

0 notes on commit d692c22

Please sign in to comment.
Something went wrong with that request. Please try again.