mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-14 13:03:13 +02:00
Prevent crash
This commit is contained in:
@@ -188,10 +188,10 @@ public class ServiceSend extends ServiceBase {
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_SECRET);
|
||||
|
||||
if (lastUnsent != null)
|
||||
if (lastUnsent != null && lastUnsent.count != null)
|
||||
builder.setContentText(getResources().getQuantityString(
|
||||
R.plurals.title_notification_unsent, lastUnsent.count, lastUnsent.count));
|
||||
if (lastUnsent == null || lastUnsent.busy == 0)
|
||||
if (lastUnsent == null || lastUnsent.busy == null || lastUnsent.busy == 0)
|
||||
builder.setSubText(getString(R.string.title_notification_idle));
|
||||
if (!lastSuitable)
|
||||
builder.setSubText(getString(R.string.title_notification_waiting));
|
||||
|
||||
@@ -21,6 +21,8 @@ package eu.faircode.email;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class TupleUnsent {
|
||||
public Integer count;
|
||||
public Integer busy;
|
||||
@@ -29,8 +31,8 @@ public class TupleUnsent {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (obj instanceof TupleUnsent) {
|
||||
TupleUnsent other = (TupleUnsent) obj;
|
||||
return (this.count.equals(other.count) &&
|
||||
this.busy.equals(other.busy));
|
||||
return (Objects.equals(this.count, other.count) &&
|
||||
Objects.equals(this.busy, other.busy));
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user