From: Reedy Date: Sat, 28 Apr 2012 00:33:24 +0000 (+0100) Subject: Attempt at fixing "Fatal error: Call to a member function getText() on a non-object... X-Git-Tag: 1.31.0-rc.0~23791^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=3e90b8b5eded19e4ab34657fc101470b0c1d818f;p=lhc%2Fweb%2Fwiklou.git Attempt at fixing "Fatal error: Call to a member function getText() on a non-object in /usr/local/apache/common-local/php-1.20wmf1/includes/api/ApiParse.php on line 209" $page->getParserOutput() can apparently return false, so seems a reasonable starting point Change-Id: I5ee1996f19405d4c854900376a3588fb1b7bbb66 --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 141f779372..c2bdeb1f5c 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -328,6 +328,9 @@ class ApiParse extends ApiBase { // Try the parser cache first // getParserOutput will save to Parser cache if able $pout = $page->getParserOutput( $popts ); + if ( !$pout ) { + $this->dieUsage( "There is no revision ID {$page->getLatest()}", 'missingrev' ); + } if ( $getWikitext ) { $this->text = $page->getRawText(); }