Ignore messages without content.

This commit is contained in:
Greyson Parrelli 2018-10-30 18:01:26 -07:00
parent 532431b0ad
commit 8c3d50c6dc

View File

@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationManagerCompat;
import android.util.Pair; import android.util.Pair;
@ -1010,7 +1011,12 @@ public class PushDecryptJob extends ContextJob {
} }
} }
private boolean shouldIgnore(@NonNull SignalServiceContent content) { private boolean shouldIgnore(@Nullable SignalServiceContent content) {
if (content == null) {
Log.w(TAG, "Got a message with null content.");
return true;
}
Recipient sender = Recipient.from(context, Address.fromExternal(context, content.getSender()), false); Recipient sender = Recipient.from(context, Address.fromExternal(context, content.getSender()), false);
if (content.getDataMessage().isPresent()) { if (content.getDataMessage().isPresent()) {