jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402120 )

Change subject: TitleBlacklistPreAuthenticationProvider: Add null assert
......................................................................


TitleBlacklistPreAuthenticationProvider: Add null assert

$req can legitimately be null, so we need to add
null to the assert as well, so the code doesn't
stop immediately.

This is a follow-up for I83f9374b2f3236097860f4aecc694326b891905b

Change-Id: I85dbc1b4c1452d0671879e6cc02c5411090b1d1d
---
M TitleBlacklistPreAuthenticationProvider.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TitleBlacklistPreAuthenticationProvider.php 
b/TitleBlacklistPreAuthenticationProvider.php
index aaea018..8c737ba 100644
--- a/TitleBlacklistPreAuthenticationProvider.php
+++ b/TitleBlacklistPreAuthenticationProvider.php
@@ -34,9 +34,13 @@
                $req = AuthenticationRequest::getRequestByClass( $reqs,
                        TitleBlacklistAuthenticationRequest::class );
                // For phan check, to ensure that $req is instance of 
\TitleBlacklistAuthenticationRequest
-               assert( $req instanceof TitleBlacklistAuthenticationRequest );
+               // or null
+               if ( $req instanceof TitleBlacklistAuthenticationRequest ) {
+                       $override = $req->ignoreTitleBlacklist;
+               } else {
+                       $override = false;
+               }
 
-               $override = $req && $req->ignoreTitleBlacklist;
                return TitleBlacklistHooks::testUserName( $user->getName(), 
$creator, $override, true );
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85dbc1b4c1452d0671879e6cc02c5411090b1d1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: wmf/1.31.0-wmf.15
Gerrit-Owner: 20after4 <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to