From 82c264dc7476a6be6a0ed4903edc37d8675d62bf Mon Sep 17 00:00:00 2001 From: addshore Date: Mon, 30 Jan 2017 17:29:00 +0000 Subject: [PATCH] EditPage: Throw exceptions on false contentModel contentModel should always have a value here. Change-Id: Iba2538f383de7da94bd0e0e3eb7d7eca4e6cee7c --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 34062c0621..a45c889c6b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1256,7 +1256,7 @@ class EditPage { $revision = $this->mArticle->getRevisionFetched(); if ( $revision === null ) { if ( !$this->contentModel ) { - $this->contentModel = $this->getTitle()->getContentModel(); + throw new RuntimeException( 'EditPage contentModel was false' ); } $handler = ContentHandler::getForModelID( $this->contentModel ); @@ -1300,7 +1300,7 @@ class EditPage { if ( $content === false || $content === null ) { if ( !$this->contentModel ) { - $this->contentModel = $this->getTitle()->getContentModel(); + throw new RuntimeException( 'EditPage contentModel was false' ); } $handler = ContentHandler::getForModelID( $this->contentModel ); -- 2.20.1