Clean up notice spew from accessing member variables of null when opening the add/edit oauth application form
This commit is contained in:
parent
f9e04993dd
commit
24bb6feba7
@ -256,8 +256,9 @@ class ApplicationEditForm extends Form
|
|||||||
|
|
||||||
// Default to Browser
|
// Default to Browser
|
||||||
|
|
||||||
if ($this->application->type == Oauth_application::$browser
|
if (empty($this->application)
|
||||||
|| empty($this->application->type)) {
|
|| empty($this->application->type)
|
||||||
|
|| $this->application->type == Oauth_application::$browser) {
|
||||||
$attrs['checked'] = 'checked';
|
$attrs['checked'] = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +275,7 @@ class ApplicationEditForm extends Form
|
|||||||
'class' => 'radio',
|
'class' => 'radio',
|
||||||
'value' => Oauth_application::$desktop);
|
'value' => Oauth_application::$desktop);
|
||||||
|
|
||||||
if ($this->application->type == Oauth_application::$desktop) {
|
if (!empty($this->application) && $this->application->type == Oauth_application::$desktop) {
|
||||||
$attrs['checked'] = 'checked';
|
$attrs['checked'] = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +299,9 @@ class ApplicationEditForm extends Form
|
|||||||
|
|
||||||
// default to read-only access
|
// default to read-only access
|
||||||
|
|
||||||
if ($this->application->access_type & Oauth_application::$readAccess
|
if (empty($this->application)
|
||||||
|| empty($this->application->access_type)) {
|
|| empty($this->application->access_type)
|
||||||
|
|| $this->application->access_type & Oauth_application::$readAccess) {
|
||||||
$attrs['checked'] = 'checked';
|
$attrs['checked'] = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +318,8 @@ class ApplicationEditForm extends Form
|
|||||||
'class' => 'radio',
|
'class' => 'radio',
|
||||||
'value' => 'rw');
|
'value' => 'rw');
|
||||||
|
|
||||||
if ($this->application->access_type & Oauth_application::$readAccess
|
if (!empty($this->application)
|
||||||
|
&& $this->application->access_type & Oauth_application::$readAccess
|
||||||
&& $this->application->access_type & Oauth_application::$writeAccess
|
&& $this->application->access_type & Oauth_application::$writeAccess
|
||||||
) {
|
) {
|
||||||
$attrs['checked'] = 'checked';
|
$attrs['checked'] = 'checked';
|
||||||
|
Loading…
Reference in New Issue
Block a user