From: Stanislav Malyshev Date: Wed, 17 Aug 2016 20:54:23 +0000 (-0700) Subject: Fix text extraction where we don't have proper file handler X-Git-Tag: 1.31.0-rc.0~6016^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=9053f5f2c63e7bd89a48890c71f47f243bfc39c3;p=lhc%2Fweb%2Fwiklou.git Fix text extraction where we don't have proper file handler Bug: T143251 Change-Id: I611f6a001bbcea971cc9126bd3f004622e88b47d --- diff --git a/includes/content/WikitextContentHandler.php b/includes/content/WikitextContentHandler.php index 9baf64331d..3ad7665ace 100644 --- a/includes/content/WikitextContentHandler.php +++ b/includes/content/WikitextContentHandler.php @@ -154,7 +154,11 @@ class WikitextContentHandler extends TextContentHandler { protected function getFileText( Title $title ) { $file = wfLocalFile( $title ); if ( $file && $file->exists() ) { - return $file->getHandler()->getEntireText( $file ); + $handler = $file->getHandler(); + if ( !$handler ) { + return null; + } + return $handler->getEntireText( $file ); } return null;