From 73a412607cdfe41fc5f5da17d2ec4c76b293addb Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 8 Oct 2011 00:16:31 +0000 Subject: [PATCH] Fixed getUsablePages() to account for the fact that getPage() can return null --- includes/SpecialPageFactory.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index eb19200f07..22aaa753e5 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -346,11 +346,9 @@ class SpecialPageFactory { $pages = array(); foreach ( self::getList() as $name => $rec ) { $page = self::getPage( $name ); - if ( $page->isListed() - && ( - !$page->isRestricted() - || $page->userCanExecute( $wgUser ) - ) + if ( $page // not null + && $page->isListed() + && ( !$page->isRestricted() || $page->userCanExecute( $wgUser ) ) ) { $pages[$name] = $page; } -- 2.20.1