Fix issue where a Job had null JobParameters.

This commit is contained in:
Greyson Parrelli 2018-10-10 09:00:14 -07:00
parent 275ca9e3ba
commit 0d48f10806
2 changed files with 2 additions and 2 deletions

View File

@ -265,7 +265,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
private void initializePendingMessages() {
if (TextSecurePreferences.getNeedsMessagePull(this)) {
Log.i(TAG, "Scheduling a message fetch.");
ApplicationContext.getInstance(this).getJobManager().add(new PushNotificationReceiveJob());
ApplicationContext.getInstance(this).getJobManager().add(new PushNotificationReceiveJob(this));
TextSecurePreferences.setNeedsMessagePull(this, false);
}
}

View File

@ -35,7 +35,7 @@ public class JobManager {
JobParameters jobParameters = job.getJobParameters();
if (jobParameters == null) {
throw new IllegalStateException("Jobs must have JobParameters at this stage.");
throw new IllegalStateException("Jobs must have JobParameters at this stage. (" + job.getClass().getSimpleName() + ")");
}
Data.Builder dataBuilder = new Data.Builder().putInt(Job.KEY_RETRY_COUNT, jobParameters.getRetryCount())