jenkins-bot has submitted this change and it was merged.

Change subject: Move Title null check in Special:RevisionDelete
......................................................................


Move Title null check in Special:RevisionDelete

The property $this->targetObj was used before null check in
SpecialRevisionDelete::getList

Move up the existing null check to avoid the fatal:

Catchable fatal error: Argument 3 passed to
RevisionDeleter::createList() must be an instance of Title, null given,
called in \includes\specials\SpecialRevisiondelete.php on line 354 and
defined in \includes\revisiondelete\RevisionDeleter.php on line 83

On request with an unknown rev id

Follow-Up: Ic078af5417798db1b2900057dbf7514112e94b46
Bug: T96538
Change-Id: I0c7913ecb11ffce844add7b1f3b810d54c367519
---
M includes/specials/SpecialRevisiondelete.php
1 file changed, 7 insertions(+), 6 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 5bd3a29..7e842d5 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -158,6 +158,13 @@
                        $this->ids
                );
 
+               # We need a target page!
+               if ( $this->targetObj === null ) {
+                       $output->addWikiMsg( 'undelete-header' );
+
+                       return;
+               }
+
                $this->typeLabels = self::$UILabels[$this->typeName];
                $list = $this->getList();
                $list->reset();
@@ -169,12 +176,6 @@
                $this->mIsAllowed = $this->mIsAllowed && !( 
$canViewSuppressedOnly && $pageIsSuppressed );
 
                $this->otherReason = $request->getVal( 'wpReason' );
-               # We need a target page!
-               if ( is_null( $this->targetObj ) ) {
-                       $output->addWikiMsg( 'undelete-header' );
-
-                       return;
-               }
                # Give a link to the logs/hist for this page
                $this->showConvenienceLinks();
 

-- 
To view, visit https://gerrit.wikimedia.org/r/215697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c7913ecb11ffce844add7b1f3b810d54c367519
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: Ybura <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to