Prevent crash

pull/196/head
M66B 5 years ago
parent 8c2f8e3265
commit fdfaf7357c

@ -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,8 +4386,9 @@ class Core {
}
}
if (notify_reply && message.content &&
db.identity().getComposableIdentities(message.account).size() > 0) {
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)
@ -4403,6 +4404,7 @@ class Core {
.setAllowGeneratedReplies(false);
mbuilder.addAction(actionReply.build());
}
}
if (notify_reply_direct &&
message.content &&

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

Loading…
Cancel
Save