mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
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.
This commit is contained in:
parent
3f7e9cb46f
commit
a2ea115650
@ -79,11 +79,11 @@ public abstract class Job extends Worker implements Serializable {
|
|||||||
((ContextDependent)this).setContext(getApplicationContext());
|
((ContextDependent)this).setContext(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize(new SafeData(data));
|
|
||||||
|
|
||||||
boolean foregroundRunning = false;
|
boolean foregroundRunning = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
initialize(new SafeData(data));
|
||||||
|
|
||||||
if (withinRetryLimits(data)) {
|
if (withinRetryLimits(data)) {
|
||||||
if (requirementsMet(data)) {
|
if (requirementsMet(data)) {
|
||||||
if (needsForegroundService(data)) {
|
if (needsForegroundService(data)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user