getUser() will always return a User object
Change-Id: Ic729992db4db459044a239ec34d95e56b013841d
This commit is contained in:
parent
1ccaa51ca8
commit
892adf0ea7
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue