From a2ea1156504588bcfb86183c703a5b330795ac43 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sat, 17 Nov 2018 09:56:52 -0800 Subject: [PATCH] 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. --- src/org/thoughtcrime/securesms/jobmanager/Job.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobmanager/Job.java b/src/org/thoughtcrime/securesms/jobmanager/Job.java index 4a96ce9717..b8d1587c3e 100644 --- a/src/org/thoughtcrime/securesms/jobmanager/Job.java +++ b/src/org/thoughtcrime/securesms/jobmanager/Job.java @@ -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)) {