Fix "Call to a member function getIsPreview() on a non-object (NULL)"

Also, the isset() checked was backwards

Bug: T116257
Change-Id: I419208bd9ad1a7a758bf9dbe0450020a9f14d39e
This commit is contained in:
Aaron Schulz 2015-10-22 13:42:19 -07:00 committed by Ori.livneh
parent 8b886471d9
commit 7bbf7c6b68
1 changed files with 3 additions and 6 deletions

View File

@ -390,12 +390,9 @@ class MathTexvc extends MathRenderer {
public function getPng() {
global $wgHooks;
// Workaround for bugfix for Bug 56769
if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) {
// saves the PNG-file
$parser = new Parser();
$text = '';
$stripState = new StripState( '' );
Hooks::run( 'ParserAfterParse', array( &$parser, &$text, &$stripState ) );
if ( isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) {
// XXX: save any pending files so the read below works
call_user_func( $wgHooks['ParserAfterParse']['FlushMathBackend'] );
}
$backend = $this->getBackend();
return $backend->getFileContents(