mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Be defensive with token availability
This commit is contained in:
parent
899eb0b235
commit
8015919932
@ -657,8 +657,10 @@ class Form extends RequestHandler {
|
||||
$extraFields = new FieldList();
|
||||
|
||||
$token = $this->getSecurityToken();
|
||||
$tokenField = $token->updateFieldSet($this->fields);
|
||||
if($tokenField) $tokenField->setForm($this);
|
||||
if ($token) {
|
||||
$tokenField = $token->updateFieldSet($this->fields);
|
||||
if($tokenField) $tokenField->setForm($this);
|
||||
}
|
||||
$this->securityTokenAdded = true;
|
||||
|
||||
// add the "real" HTTP method if necessary (for PUT, DELETE and HEAD)
|
||||
|
Loading…
Reference in New Issue
Block a user