Ensure that the unknown UUID does not create an entry.

This commit is contained in:
Alan Evans 2020-05-13 14:14:12 -03:00 committed by Alex Hart
parent ccff7b1148
commit ef86372635

View file

@ -151,6 +151,10 @@ public class Recipient {
*/ */
@WorkerThread @WorkerThread
public static @NonNull Recipient externalPush(@NonNull Context context, @Nullable UUID uuid, @Nullable String e164) { public static @NonNull Recipient externalPush(@NonNull Context context, @Nullable UUID uuid, @Nullable String e164) {
if (UuidUtil.UNKNOWN_UUID.equals(uuid)) {
throw new AssertionError();
}
RecipientDatabase db = DatabaseFactory.getRecipientDatabase(context); RecipientDatabase db = DatabaseFactory.getRecipientDatabase(context);
Optional<RecipientId> uuidUser = uuid != null ? db.getByUuid(uuid) : Optional.absent(); Optional<RecipientId> uuidUser = uuid != null ? db.getByUuid(uuid) : Optional.absent();
Optional<RecipientId> e164User = e164 != null ? db.getByE164(e164) : Optional.absent(); Optional<RecipientId> e164User = e164 != null ? db.getByE164(e164) : Optional.absent();