mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
db42713e1c
commit
cf2ea6ea60
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user