]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix warning in subscribers/subscriptions list pages where we attempted to call free...
authorBrion Vibber <brion@pobox.com>
Fri, 7 Jan 2011 23:29:30 +0000 (15:29 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 7 Jan 2011 23:29:30 +0000 (15:29 -0800)
Removed the free calls (unneeded since destructors now work), and added an error check w/ logging & an exception for future attempts to forward calls to nonexistent object.

actions/subscribers.php
actions/subscriptions.php
lib/arraywrapper.php

index 2862f35c6d275eac8596c8b686ba3434dcb5f1c3..ad522a4bae63372b0632f302ec794a329ba88735 100644 (file)
@@ -100,8 +100,6 @@ class SubscribersAction extends GalleryAction
             }
         }
 
-        $subscribers->free();
-
         $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                           $this->page, 'subscribers',
                           array('nickname' => $this->user->nickname));
index a814a4f354172dd4d24ec2c3156590f576ecdc01..ddcf237e6271647552f19c7253fa9535b24b5082 100644 (file)
@@ -106,8 +106,6 @@ class SubscriptionsAction extends GalleryAction
                 }
             }
 
-            $subscriptions->free();
-
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'subscriptions',
                               array('nickname' => $this->user->nickname));
index 8a1cdd96e1f03363a766361b0582f3bfc7acf6ce..f9d3c3cf946313d14b35b2ee4cfca2fd1e59a706 100644 (file)
@@ -76,6 +76,10 @@ class ArrayWrapper
     function __call($name, $args)
     {
         $item =& $this->_items[$this->_i];
+        if (!is_object($item)) {
+            common_log(LOG_ERR, "Invalid entry " . var_export($item, true) . " at index $this->_i of $this->N; calling $name()");
+            throw new ServerException("Internal error: bad entry in array wrapper list.");
+        }
         return call_user_func_array(array($item, $name), $args);
     }
 }