mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 23:26:12 +02:00
Prevent crash
This commit is contained in:
@@ -219,7 +219,8 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
|
||||
@Override
|
||||
protected Boolean onExecute(Context context, Bundle args) {
|
||||
DB db = DB.getInstance(context);
|
||||
return (db.identity().getComposableIdentities(null).size() > 0);
|
||||
List<TupleIdentityEx> identities = db.identity().getComposableIdentities(null);
|
||||
return (identities != null && identities.size() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4386,22 +4386,24 @@ class Core {
|
||||
}
|
||||
}
|
||||
|
||||
if (notify_reply && message.content &&
|
||||
db.identity().getComposableIdentities(message.account).size() > 0) {
|
||||
Intent reply = new Intent(context, ActivityCompose.class)
|
||||
.putExtra("action", "reply")
|
||||
.putExtra("reference", message.id)
|
||||
.putExtra("group", group);
|
||||
reply.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent piReply = PendingIntent.getActivity(context, ActivityCompose.PI_REPLY, reply, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
NotificationCompat.Action.Builder actionReply = new NotificationCompat.Action.Builder(
|
||||
R.drawable.twotone_reply_24,
|
||||
context.getString(R.string.title_advanced_notify_action_reply),
|
||||
piReply)
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_REPLY)
|
||||
.setShowsUserInterface(true)
|
||||
.setAllowGeneratedReplies(false);
|
||||
mbuilder.addAction(actionReply.build());
|
||||
if (notify_reply && message.content) {
|
||||
List<TupleIdentityEx> identities = db.identity().getComposableIdentities(message.account);
|
||||
if (identities != null && identities.size() > 0) {
|
||||
Intent reply = new Intent(context, ActivityCompose.class)
|
||||
.putExtra("action", "reply")
|
||||
.putExtra("reference", message.id)
|
||||
.putExtra("group", group);
|
||||
reply.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent piReply = PendingIntent.getActivity(context, ActivityCompose.PI_REPLY, reply, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
NotificationCompat.Action.Builder actionReply = new NotificationCompat.Action.Builder(
|
||||
R.drawable.twotone_reply_24,
|
||||
context.getString(R.string.title_advanced_notify_action_reply),
|
||||
piReply)
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_REPLY)
|
||||
.setShowsUserInterface(true)
|
||||
.setAllowGeneratedReplies(false);
|
||||
mbuilder.addAction(actionReply.build());
|
||||
}
|
||||
}
|
||||
|
||||
if (notify_reply_direct &&
|
||||
|
||||
@@ -45,6 +45,7 @@ import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FragmentDialogIdentity extends FragmentDialogBase {
|
||||
@@ -133,6 +134,9 @@ public class FragmentDialogIdentity extends FragmentDialogBase {
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, List<TupleIdentityEx> identities) {
|
||||
if (identities == null)
|
||||
identities = new ArrayList<>();
|
||||
|
||||
AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), identities);
|
||||
spIdentity.setAdapter(iadapter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user