Merge "Simplify code by replacing isset() with falsy check"

This commit is contained in:
jenkins-bot 2024-10-28 17:02:32 +00:00 committed by Gerrit Code Review
commit 5a930d59d3

View file

@ -74,16 +74,17 @@ class AbuseFilterViewHistory extends AbuseFilterView {
$canViewProtectedVars = $this->afPermManager->canViewProtectedVariables( $this->getAuthority() );
if ( $filter ) {
$filterObj = null;
try {
$filterObj = $this->filterLookup->getFilter( $filter, false );
} catch ( FilterNotFoundException $_ ) {
$filter = null;
}
if ( isset( $filterObj ) && $filterObj->isHidden() && !$canViewPrivate ) {
if ( $filterObj && $filterObj->isHidden() && !$canViewPrivate ) {
$out->addWikiMsg( 'abusefilter-history-error-hidden' );
return;
}
if ( isset( $filterObj ) && $filterObj->isProtected() && !$canViewProtectedVars ) {
if ( $filterObj && $filterObj->isProtected() && !$canViewProtectedVars ) {
$out->addWikiMsg( 'abusefilter-history-error-protected' );
return;
}