Skip to content

Commit

Permalink
Ensure that the unknown UUID does not create an entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-signal authored and alex-signal committed May 14, 2020
1 parent ccff7b1 commit ef86372
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ public class Recipient {
*/
@WorkerThread
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);
Optional<RecipientId> uuidUser = uuid != null ? db.getByUuid(uuid) : Optional.absent();
Optional<RecipientId> e164User = e164 != null ? db.getByE164(e164) : Optional.absent();
Expand Down

0 comments on commit ef86372

Please sign in to comment.