The check makes sure that the page id is known for the title
passed to the constructor. LinksUpdate needs to know this id in
order to update the various links tables. If the page id is not
known to the title (e.g. because the page doesn't actually exist)
something is wrong, and LinksUpdate can't operate.
Amend: use MWException instead of assert()
Change-Id: I4873211a71099fe3563b52a53532c95b6a2ff30f
$this->mTitle = $title;
$this->mId = $title->getArticleID();
+ if ( !$this->mId ) {
+ throw new MWException( "The Title object did not provide an article ID. Perhaps the page doesn't exist?" );
+ }
+
$this->mParserOutput = $parserOutput;
$this->mLinks = $parserOutput->getLinks();
$this->mImages = $parserOutput->getImages();