Initialize jobs in the try block.

In the case where we add new fields to a Job's InputData, we want to
make sure that initialize() is called in the try block so that if it
fails, it simply fails the job (allowing the user to retry with the new
field) instead of crashing.
pull/1/head
Greyson Parrelli 6 years ago
parent 3f7e9cb46f
commit a2ea115650

@ -79,11 +79,11 @@ public abstract class Job extends Worker implements Serializable {
((ContextDependent)this).setContext(getApplicationContext());
}
initialize(new SafeData(data));
boolean foregroundRunning = false;
try {
initialize(new SafeData(data));
if (withinRetryLimits(data)) {
if (requirementsMet(data)) {
if (needsForegroundService(data)) {

Loading…
Cancel
Save