Guard against method call on null

Repeat the same check as in ::isBlacklisted() without the comment

Bug: T376584
Change-Id: I45adc3a5e4c8330e8120db1afb585ca4f77c99cd
This commit is contained in:
Ammarpad 2024-10-07 09:16:42 +01:00
parent 4382b2f8e1
commit feafa06dd0

View file

@ -253,6 +253,9 @@ class TitleBlacklist {
public function isWhitelisted( $title, $action = 'edit' ) { public function isWhitelisted( $title, $action = 'edit' ) {
if ( !( $title instanceof Title ) ) { if ( !( $title instanceof Title ) ) {
$title = Title::newFromText( $title ); $title = Title::newFromText( $title );
if ( !$title ) {
return false;
}
} }
$whitelist = $this->getWhitelist(); $whitelist = $this->getWhitelist();
foreach ( $whitelist as $item ) { foreach ( $whitelist as $item ) {