Merge "Don't make unchecked method call on object that might be null"

This commit is contained in:
jenkins-bot 2020-07-01 16:07:53 +00:00 committed by Gerrit Code Review
commit d891751f11

View file

@ -1626,11 +1626,12 @@ class EchoHooks {
public static function onSpecialMuteModifyFormFields( SpecialMute $specialMute, &$fields ) {
$echoPerUserBlacklist = MediaWikiServices::getInstance()->getMainConfig()->get( 'EchoPerUserBlacklist' );
if ( $echoPerUserBlacklist ) {
$target = $specialMute->getTarget();
$fields[ 'echo-notifications-blacklist'] = [
'type' => 'check',
'label-message' => [
'echo-specialmute-label-mute-notifications',
$specialMute->getTarget()->getName()
$target ? $target->getName() : ''
],
'default' => $specialMute->isTargetBlacklisted( 'echo-notifications-blacklist' ),
];