Limit impact of crash on unexpected SMS receive.
This commit is contained in:
parent
ef6019f13b
commit
02865f99a9
1 changed files with 7 additions and 2 deletions
|
@ -71,8 +71,10 @@ public class SmsReceiveJob extends BaseJob {
|
|||
|
||||
@Override
|
||||
public void onRun() throws MigrationPendingException {
|
||||
Log.i(TAG, "onRun()");
|
||||
|
||||
if (TextSecurePreferences.getLocalUuid(context) == null && TextSecurePreferences.getLocalNumber(context) == null) {
|
||||
throw new NotReadyException();
|
||||
}
|
||||
|
||||
Optional<IncomingTextMessage> message = assembleMessageFragments(pdus, subscriptionId);
|
||||
|
||||
if (message.isPresent() && !isBlocked(message.get())) {
|
||||
|
@ -167,4 +169,7 @@ public class SmsReceiveJob extends BaseJob {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class NotReadyException extends RuntimeException {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue