Check if SpecialMobileWatchlist exist

If MobileFrontend doesn't exist this will throw an error

Bug: T171241
Change-Id: Ie61cfa61b78a53598ac59aea15c8a4e6a261238d
This commit is contained in:
jdlrobson 2017-08-17 16:59:12 -05:00 committed by Jdlrobson
parent f08b6defd7
commit d5e09c91e9
1 changed files with 10 additions and 7 deletions

View File

@ -470,6 +470,8 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
$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 ) {
@ -479,6 +481,7 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
$watchlistQuery['filter'] = $filter;
}
}
}
$menu->insert( 'watchlist', $isJSOnly = true )
->addComponent(