From 626af349d13fd33e1ec9eb28efc28cb27d7b612c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 18 Jan 2013 18:50:38 +0000 Subject: [PATCH] Check for no title and throw an exception Fatal errors break test execution, exceptions not See also bug 42145 PS: how many months does it take to fix a bug that prevents running unit tests? Answer below. Change-Id: I0b351a05be9d0850b467046e807651be254dcae2 --- includes/OutputPage.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index b040f956d2..5b0f36c5a1 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1435,6 +1435,9 @@ class OutputPage extends ContextSource { */ public function addWikiText( $text, $linestart = true, $interface = true ) { $title = $this->getTitle(); // Work arround E_STRICT + if ( !$title ) { + throw new MWException( 'Title is null' ); + } $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface ); } -- 2.20.1