Revision::newNullRevision don't pass null to RevisionStore
authoraddshore <addshorewiki@gmail.com>
Thu, 11 Jan 2018 09:22:16 +0000 (09:22 +0000)
committeraddshore <addshorewiki@gmail.com>
Thu, 11 Jan 2018 09:22:16 +0000 (09:22 +0000)
commit54f0872c7f8549745e10930dc99eb83444c62c21
treefebe6a8df14fd1bd38941349b9eb773b329d294a
parentfded33d6deb75ecd50eb5ba8f1bea03106474308
Revision::newNullRevision don't pass null to RevisionStore

RevisionStore::newNullRevision must be passed a Title object when
being used, passing null will result in a fatal.

Title::newFromID can return null, so check and return null early if we
have no Title object.

Also use Title::GAID_FOR_UPDATE for a higher chance of getting a Title.
Prior to the Revision overhaul newNullRevision would have always done a
select from master, it is documented as accepting $dbw and also passed
FOR UPDATE as an option to selectRow.

Bug: T184687
Change-Id: If1f99d091ab9cd37d514a4f4cbf3c28b64426cb7
includes/Revision.php