getUser() will always return a User object

Change-Id: Ic729992db4db459044a239ec34d95e56b013841d
This commit is contained in:
Kunal Mehta 2018-04-15 16:55:25 -07:00 committed by Jdlrobson
parent 1ccaa51ca8
commit 892adf0ea7
1 changed files with 9 additions and 11 deletions

View File

@ -498,17 +498,15 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
// Watchlist link
$watchlistQuery = [];
$user = $this->getUser();
if ( $user ) {
// Avoid fatal when MobileFrontend not available (T171241)
if ( class_exists( 'SpecialMobileWatchlist' ) ) {
$view = $user->getOption( SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
$filter = $user->getOption( SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
if ( $view ) {
$watchlistQuery['watchlistview'] = $view;
}
if ( $filter && $view === 'feed' ) {
$watchlistQuery['filter'] = $filter;
}
// Avoid fatal when MobileFrontend not available (T171241)
if ( class_exists( 'SpecialMobileWatchlist' ) ) {
$view = $user->getOption( SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
$filter = $user->getOption( SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
if ( $view ) {
$watchlistQuery['watchlistview'] = $view;
}
if ( $filter && $view === 'feed' ) {
$watchlistQuery['filter'] = $filter;
}
}