Skip to content

Commit

Permalink
Fix possible crash for unregistered devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Oct 15, 2020
1 parent 089656e commit 385bd0e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.thoughtcrime.securesms.util.ProfileUtil;
import org.thoughtcrime.securesms.util.SetUtil;
import org.thoughtcrime.securesms.util.Stopwatch;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
import org.whispersystems.libsignal.IdentityKey;
Expand Down Expand Up @@ -167,7 +168,10 @@ public static void enqueue(@NonNull Set<RecipientId> recipientIds) {
* certain time period.
*/
public static void enqueueRoutineFetchIfNecessary(Application application) {
if (!SignalStore.registrationValues().isRegistrationComplete()) {
if (!SignalStore.registrationValues().isRegistrationComplete() ||
!TextSecurePreferences.isPushRegistered(application) ||
TextSecurePreferences.getLocalUuid(application) == null)
{
Log.i(TAG, "Registration not complete. Skipping.");
return;
}
Expand Down

0 comments on commit 385bd0e

Please sign in to comment.