Only parse baseURl if not empty

Fixes #1422

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-07-08 14:49:59 +02:00
parent 9da85eec83
commit e1962883b0
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -22,6 +22,7 @@ package com.nextcloud.talk.adapters.items;
import android.accounts.Account;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
@ -123,7 +124,9 @@ public class AdvancedUserItem extends AbstractFlexibleItem<AdvancedUserItem.User
holder.contactDisplayName.setText(participant.getDisplayName());
}
if (userEntity != null && !TextUtils.isEmpty(userEntity.getBaseUrl())) {
holder.serverUrl.setText((Uri.parse(userEntity.getBaseUrl()).getHost()));
}
holder.avatarImageView.getHierarchy().setPlaceholderImage(R.drawable.account_circle_48dp);
holder.avatarImageView.getHierarchy().setFailureImage(R.drawable.account_circle_48dp);