Fix potential crash, and hide the account link menu if there is no account

This commit is contained in:
QuentinArguillere 2021-09-15 15:53:05 +02:00
parent ccbf220270
commit b6aefc2de9
2 changed files with 3 additions and 2 deletions

View file

@ -68,7 +68,7 @@
assistant_activate_phone_number_link);
LinphoneAccount *acc = linphone_core_get_default_account(LC);
LinphoneAccountParams const *accParams = linphone_account_get_params(acc);
LinphoneAccountParams const *accParams = (acc) ? linphone_account_get_params(acc) : NULL;
if (acc &&
strcmp([LinphoneManager.instance lpConfigStringForKey:@"domain_name"
inSection:@"app"

View file

@ -65,7 +65,8 @@
changeCurrentView:AssistantView.compositeViewDescription];
}]];
BOOL mustLink = ([LinphoneManager.instance lpConfigIntForKey:@"must_link_account_time"] > 0);
if (mustLink) {
BOOL hasAccount = linphone_core_get_account_list(LC) != NULL;
if (mustLink && hasAccount) {
[_sideMenuEntries
addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Link my account", nil)
image:[UIImage imageNamed:@"menu_link_account.png"]