summaryrefslogtreecommitdiff
path: root/lib/applicationeditform.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-20 16:39:51 -0700
committerBrion Vibber <brion@pobox.com>2010-09-20 16:39:51 -0700
commit24bb6feba708d68764a35a4209760be712a8221a (patch)
tree1b00298028cd44d747fd8bc2e861d4a7c0f3f88b /lib/applicationeditform.php
parentf9e04993dd965ba0bbf812742ee17f900c541be0 (diff)
Clean up notice spew from accessing member variables of null when opening the add/edit oauth application form
Diffstat (limited to 'lib/applicationeditform.php')
-rw-r--r--lib/applicationeditform.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/applicationeditform.php b/lib/applicationeditform.php
index f126b84ae..224b6eaa1 100644
--- a/lib/applicationeditform.php
+++ b/lib/applicationeditform.php
@@ -256,8 +256,9 @@ class ApplicationEditForm extends Form
// Default to Browser
- if ($this->application->type == Oauth_application::$browser
- || empty($this->application->type)) {
+ if (empty($this->application)
+ || empty($this->application->type)
+ || $this->application->type == Oauth_application::$browser) {
$attrs['checked'] = 'checked';
}
@@ -274,7 +275,7 @@ class ApplicationEditForm extends Form
'class' => 'radio',
'value' => Oauth_application::$desktop);
- if ($this->application->type == Oauth_application::$desktop) {
+ if (!empty($this->application) && $this->application->type == Oauth_application::$desktop) {
$attrs['checked'] = 'checked';
}
@@ -298,8 +299,9 @@ class ApplicationEditForm extends Form
// default to read-only access
- if ($this->application->access_type & Oauth_application::$readAccess
- || empty($this->application->access_type)) {
+ if (empty($this->application)
+ || empty($this->application->access_type)
+ || $this->application->access_type & Oauth_application::$readAccess) {
$attrs['checked'] = 'checked';
}
@@ -316,7 +318,8 @@ class ApplicationEditForm extends Form
'class' => 'radio',
'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
) {
$attrs['checked'] = 'checked';