Fix crash in [SettingsViewController heightForHeaderInSection:]

This commit is contained in:
manuroe
2016-09-01 17:35:22 +02:00
parent cd31da7609
commit d5303208c2
@@ -1124,11 +1124,14 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
{
if (section == SETTINGS_SECTION_IGNORED_USERS_INDEX)
{
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
if (session.ignoredUsers.count == 0)
if ([AppDelegate theDelegate].mxSessions.count > 0)
{
// Hide this section
return SECTION_TITLE_PADDING_WHEN_HIDDEN;
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
if (session.ignoredUsers.count == 0)
{
// Hide this section
return SECTION_TITLE_PADDING_WHEN_HIDDEN;
}
}
}