]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Clean up notice spew from accessing member variables of null when opening the add...
authorBrion Vibber <brion@pobox.com>
Mon, 20 Sep 2010 23:39:51 +0000 (16:39 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 20 Sep 2010 23:39:51 +0000 (16:39 -0700)
lib/applicationeditform.php

index f126b84ae33150de76b1d1dec6cfc486eadf10e5..224b6eaa1b62de73ebe71ddd4a7feabbd9a50553 100644 (file)
@@ -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';