mlanthaler: Bugfix: Added check if variable is set.

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42021 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 01:50:43 +00:00
parent db42713e1c
commit cf2ea6ea60

View File

@ -38,7 +38,7 @@ class ImageField extends FileField {
$data = $this->form->getRecord();
// if the record was written for the first time (has an arbitrary "new"-ID),
// update the imagefield to enable uploading
if($record->ID && substr($data->ID, 0, 3) == 'new') {
if($record->ID && $data && substr($data->ID, 0, 3) == 'new') {
FormResponse::update_dom_id($this->id(), $this->Field($record->ID));
}
}