From: Brion Vibber Date: Fri, 7 Jan 2011 23:29:30 +0000 (-0800) Subject: Fix warning in subscribers/subscriptions list pages where we attempted to call free... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5616bfb5ffa3af4c6a375ff9c8c8560d86208898;p=quix0rs-gnu-social.git Fix warning in subscribers/subscriptions list pages where we attempted to call free() an ArrayWrapper after it was used up, thus trying to forward the call to a nonexistent object. 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. --- diff --git a/actions/subscribers.php b/actions/subscribers.php index 2862f35c6d..ad522a4bae 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -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)); diff --git a/actions/subscriptions.php b/actions/subscriptions.php index a814a4f354..ddcf237e62 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -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)); diff --git a/lib/arraywrapper.php b/lib/arraywrapper.php index 8a1cdd96e1..f9d3c3cf94 100644 --- a/lib/arraywrapper.php +++ b/lib/arraywrapper.php @@ -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); } }