From c4eb9569b96775850fc68f7452534ab3cccb5fd6 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 19 Mar 2019 17:07:40 +0000 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/Shortcuts.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Shortcuts.java b/app/src/main/java/eu/faircode/email/Shortcuts.java index 6bc79e69c4..cfa11a0c3e 100644 --- a/app/src/main/java/eu/faircode/email/Shortcuts.java +++ b/app/src/main/java/eu/faircode/email/Shortcuts.java @@ -13,6 +13,7 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.provider.ContactsContract; +import android.text.TextUtils; import java.io.InputStream; import java.util.ArrayList; @@ -61,7 +62,7 @@ public class Shortcuts { new ShortcutInfo.Builder(context, Long.toString(contact.id)) .setIcon(icon) .setRank(shortcuts.size() + 1) - .setShortLabel(contact.name == null ? contact.email : contact.name) + .setShortLabel(TextUtils.isEmpty(contact.name) ? contact.email : contact.name) .setIntent(intent) .build()); }