Prevent crash

This commit is contained in:
M66B 2019-03-19 17:07:40 +00:00
parent 67810892ce
commit c4eb9569b9
1 changed files with 2 additions and 1 deletions

View File

@ -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());
}