From: Brion Vibber Date: Wed, 27 Apr 2005 21:40:21 +0000 (+0000) Subject: Avoid 'trying to get property of non-object' notices X-Git-Tag: 1.5.0alpha1~102 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=863363e6101fd66b75c4a0f2021c22c133d98e3e;p=lhc%2Fweb%2Fwiklou.git Avoid 'trying to get property of non-object' notices --- diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 1b300745d7..e9a5676e7a 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -40,7 +40,7 @@ require_once('QueryPage.php'); class ListUsersPage extends QueryPage { var $requestedGroup = ''; var $requestedUser = ''; - var $previousResult = false; + var $previousResult = null; var $concatGroups = ''; function getName() { @@ -150,17 +150,18 @@ class ListUsersPage extends QueryPage { function formatResult( $skin, $result ) { global $wgContLang; $name = false; - - if($this->previousResult->title != $result->title && $this->previousResult != false) { + + if( is_object( $this->previousResult ) && + (is_null( $result ) || ( $this->previousResult->title != $result->title ) ) ) { // Different username, give back name(group1,group2) $name = $skin->makeLink( $wgContLang->getNsText($this->previousResult->namespace) . ':' . $this->previousResult->title, $this->previousResult->title ); $name .= $this->concatGroups ? '('.substr($this->concatGroups,0,-1).')' : ''; $this->clearGroups(); } - if($result->type != '') { - $this->appendGroups( $skin->makeLink( wfMsgForContent( 'administrators' ), $result->type ) ); - } + if( is_object( $result ) && $result->type != '') { + $this->appendGroups( $skin->makeLink( wfMsgForContent( 'administrators' ), $result->type ) ); + } $this->previousResult = $result; return $name;