Remove throws from Title::getContentModel()
authorFlorianschmidtwelzow <florian.schmidt.welzow@t-online.de>
Mon, 27 Apr 2015 09:51:53 +0000 (11:51 +0200)
committerFlorianschmidtwelzow <florian.schmidt.welzow@t-online.de>
Mon, 27 Apr 2015 09:51:53 +0000 (11:51 +0200)
ContentHandler::getDefaultModelFor() always returns a contentmodel,
so this exception is never thrown.

Change-Id: I7678964f229da8fcd15eb49e9e8c8e9a258e35a1

includes/Title.php

index b0df15f..7e2b39e 100644 (file)
@@ -940,7 +940,6 @@ class Title {
        /**
         * Get the page's content model id, see the CONTENT_MODEL_XXX constants.
         *
-        * @throws MWException
         * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
         * @return string Content model id
         */
@@ -955,10 +954,6 @@ class Title {
                        $this->mContentModel = ContentHandler::getDefaultModelFor( $this );
                }
 
-               if ( !$this->mContentModel ) {
-                       throw new MWException( 'Failed to determine content model!' );
-               }
-
                return $this->mContentModel;
        }