From: addshore Date: Mon, 30 Jan 2017 17:29:00 +0000 (+0000) Subject: EditPage: Throw exceptions on false contentModel X-Git-Tag: 1.31.0-rc.0~4020^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=82c264dc7476a6be6a0ed4903edc37d8675d62bf;p=lhc%2Fweb%2Fwiklou.git EditPage: Throw exceptions on false contentModel contentModel should always have a value here. Change-Id: Iba2538f383de7da94bd0e0e3eb7d7eca4e6cee7c --- 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 );