Steps to reproduce:
- Create a page, do three edits. It should have four lines in its history.
- With an oversight account, select the too oldest revs (the creation and the first edit) and delete them (mark "hide the content" "also for admins")
- With a simple admin account, go to Special:Undelete, the two more recent "diff" links are blue. When you click on the second diff, an error is shown.
The error appear when an admin tries to see a diff between two revs, when one of both of them was deleted.
Backtrace I reproduced on vagrant:
[d2fc727824a22ed6c87bda38] /w/index.php?title=Special:Undelete&target=Test×tamp=20180827184204&diff=prev TypeError from line 1200 of /vagrant/mediawiki/includes/diff/DifferenceEngine.php: Argument 1 passed to DifferenceEngine::generateContentDiffBody() must implement interface Content, null given, called in /vagrant/mediawiki/includes/specials/SpecialUndelete.php on line 537 Backtrace: #0 /vagrant/mediawiki/includes/specials/SpecialUndelete.php(537): DifferenceEngine->generateContentDiffBody(NULL, WikitextContent) #1 /vagrant/mediawiki/includes/specials/SpecialUndelete.php(399): SpecialUndelete->showDiff(Revision, Revision) #2 /vagrant/mediawiki/includes/specials/SpecialUndelete.php(182): SpecialUndelete->showRevision(string) #3 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(569): SpecialUndelete->execute(NULL) #4 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(NULL) #5 /vagrant/mediawiki/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext) #6 /vagrant/mediawiki/includes/MediaWiki.php(868): MediaWiki->performRequest() #7 /vagrant/mediawiki/includes/MediaWiki.php(525): MediaWiki->main() #8 /vagrant/mediawiki/index.php(42): MediaWiki->run() #9 /var/www/w/index.php(5): require(string) #10 {main}
{F25440944}
Reported by @Bastenbas