Fixed empty signatures

pull/147/head
M66B 6 years ago
parent b500ea1995
commit 3917f0401e

@ -223,9 +223,9 @@ public class FragmentCompose extends FragmentEx {
int at = (identity == null ? -1 : identity.email.indexOf('@')); int at = (identity == null ? -1 : identity.email.indexOf('@'));
tvExtraPrefix.setText(at < 0 ? null : identity.email.substring(0, at)); tvExtraPrefix.setText(at < 0 ? null : identity.email.substring(0, at));
tvExtraSuffix.setText(at < 0 ? null : identity.email.substring(at)); tvExtraSuffix.setText(at < 0 ? null : identity.email.substring(at));
Spanned signature = null;
if (pro) { if (pro) {
Spanned signature = null; if (identity != null && !TextUtils.isEmpty(identity.signature))
if (identity != null && identity.signature != null)
signature = Html.fromHtml(identity.signature, new Html.ImageGetter() { signature = Html.fromHtml(identity.signature, new Html.ImageGetter() {
@Override @Override
public Drawable getDrawable(String source) { public Drawable getDrawable(String source) {
@ -236,9 +236,9 @@ public class FragmentCompose extends FragmentEx {
return d; return d;
} }
}, null); }, null);
tvSignature.setText(signature);
grpSignature.setVisibility(signature == null ? View.GONE : View.VISIBLE);
} }
tvSignature.setText(signature);
grpSignature.setVisibility(signature == null ? View.GONE : View.VISIBLE);
} }
@Override @Override

@ -704,7 +704,8 @@ public class FragmentIdentity extends FragmentEx {
etEmail.setText(identity == null ? null : identity.email); etEmail.setText(identity == null ? null : identity.email);
etDisplay.setText(identity == null ? null : identity.display); etDisplay.setText(identity == null ? null : identity.display);
etSignature.setText(identity == null || identity.signature == null ? null : Html.fromHtml(identity.signature)); etSignature.setText(identity == null ||
TextUtils.isEmpty(identity.signature) ? null : Html.fromHtml(identity.signature));
etHost.setText(identity == null ? null : identity.host); etHost.setText(identity == null ? null : identity.host);
cbStartTls.setChecked(identity == null ? false : identity.starttls); cbStartTls.setChecked(identity == null ? false : identity.starttls);

Loading…
Cancel
Save