From 26d114090a04fc589cd00aa4432407b3e1ce01f5 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 1 May 2014 10:12:25 -0400 Subject: [PATCH] Avoid fatal in Article::fetchContent() The function is documented as returning false if there is no content to the page, but this logic was lost in the ContentHandler change. Even though it's "BC cruft", it still shouldn't fatal for something as simple as a non-existent page. Bug: 43737 Change-Id: Ic1924a42fa7b4227ac65838d0def6a66c3990573 --- includes/Article.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/Article.php b/includes/Article.php index e73fe9d640..0a4b5ee30e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -386,6 +386,11 @@ class Article implements Page { $content = $this->fetchContentObject(); + if ( !$content ) { + wfProfileOut( __METHOD__ ); + return false; + } + // @todo Get rid of mContent everywhere! $this->mContent = ContentHandler::getContentText( $content ); ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) ); -- 2.20.1