Fix crash when player is not logged in. See #2453 for more details.

This commit is contained in:
hiker 2016-03-16 22:29:51 +11:00
parent 90f82494f7
commit c6b22cdffb

View File

@ -81,6 +81,15 @@ void OnlineProfileBase::loadedFromFile()
void OnlineProfileBase::beforeAddingWidget()
{
m_visiting_profile = ProfileManager::get()->getVisitingProfile();
} // beforeAddingWidget
// -----------------------------------------------------------------------------
/** Called when entering this menu (before widgets are added).
*/
void OnlineProfileBase::init()
{
Screen::init();
if (m_profile_tabs)
{
if (!m_visiting_profile || !m_visiting_profile->isCurrentUser())
@ -95,14 +104,6 @@ void OnlineProfileBase::beforeAddingWidget()
m_profile_tabs->setVisible(false);
}
} // if m_profile_tabhs
} // beforeAddingWidget
// -----------------------------------------------------------------------------
/** Called when entering this menu (before widgets are added).
*/
void OnlineProfileBase::init()
{
Screen::init();
if (m_profile_tabs)
{