mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 09:20:23 +00:00
Prevent some crash loops.
This commit is contained in:
@@ -100,6 +100,10 @@ public class MmsDownloadJob extends BaseJob {
|
||||
|
||||
@Override
|
||||
public void onRun() {
|
||||
if (TextSecurePreferences.getLocalUuid(context) == null && TextSecurePreferences.getLocalNumber(context) == null) {
|
||||
throw new NotReadyException();
|
||||
}
|
||||
|
||||
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
||||
Optional<MmsDatabase.MmsNotificationInfo> notification = database.getNotification(messageId);
|
||||
|
||||
@@ -265,4 +269,7 @@ public class MmsDownloadJob extends BaseJob {
|
||||
data.getBoolean(KEY_AUTOMATIC));
|
||||
}
|
||||
}
|
||||
|
||||
private static class NotReadyException extends RuntimeException {
|
||||
}
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public class RefreshAttributesJob extends BaseJob {
|
||||
|
||||
@Override
|
||||
public void onRun() throws IOException {
|
||||
if (!TextSecurePreferences.isPushRegistered(context)) {
|
||||
if (!TextSecurePreferences.isPushRegistered(context) || TextSecurePreferences.getLocalNumber(context) == null) {
|
||||
Log.w(TAG, "Not yet registered. Skipping.");
|
||||
return;
|
||||
}
|
||||
|
@@ -170,6 +170,6 @@ public class SmsReceiveJob extends BaseJob {
|
||||
}
|
||||
}
|
||||
|
||||
private class NotReadyException extends RuntimeException {
|
||||
private static class NotReadyException extends RuntimeException {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user