Check for no title and throw an exception
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Fri, 18 Jan 2013 18:50:38 +0000 (18:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 18 Jan 2013 19:05:04 +0000 (19:05 +0000)
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

index b040f95..5b0f36c 100644 (file)
@@ -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 );
        }