mirror of https://github.com/M66B/FairEmail.git
Added fail-safe
This commit is contained in:
parent
ee8b976dc6
commit
d0a97331eb
|
@ -52,7 +52,9 @@ public class FragmentDialogSelectAccount extends FragmentDialogBase {
|
|||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
View view = super.getView(position, convertView, parent);
|
||||
EntityAccount account = (EntityAccount) getItem(position);
|
||||
|
||||
try {
|
||||
EntityAccount account = getItem(position);
|
||||
|
||||
View vwColor = view.findViewById(R.id.vwColor);
|
||||
TextView tv = view.findViewById(android.R.id.text1);
|
||||
|
@ -62,6 +64,9 @@ public class FragmentDialogSelectAccount extends FragmentDialogBase {
|
|||
|
||||
vwColor.setBackgroundColor(account.color == null ? Color.TRANSPARENT : account.color);
|
||||
tv.setText(account.name);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,8 @@ public class FragmentDialogSelectIdentity extends FragmentDialogBase {
|
|||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
View view = super.getView(position, convertView, parent);
|
||||
|
||||
try {
|
||||
TupleIdentityEx identity = getItem(position);
|
||||
|
||||
View vwColor = view.findViewById(R.id.vwColor);
|
||||
|
@ -62,6 +64,9 @@ public class FragmentDialogSelectIdentity extends FragmentDialogBase {
|
|||
Integer color = (identity.color == null ? identity.accountColor : identity.color);
|
||||
vwColor.setBackgroundColor(color == null ? Color.TRANSPARENT : color);
|
||||
tv.setText(identity.getDisplayName());
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue