Fix NPE on contact update request

Fixes #6840

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-08-01 08:57:26 -07:00
parent 45ecca69d3
commit 4229c21bdc

View File

@ -57,11 +57,11 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje
private final @Nullable String address; private final @Nullable String address;
public MultiDeviceContactUpdateJob(Context context) { public MultiDeviceContactUpdateJob(@NonNull Context context) {
this(context, null); this(context, null);
} }
public MultiDeviceContactUpdateJob(Context context, Address address) { public MultiDeviceContactUpdateJob(@NonNull Context context, @Nullable Address address) {
super(context, JobParameters.newBuilder() super(context, JobParameters.newBuilder()
.withRequirement(new NetworkRequirement(context)) .withRequirement(new NetworkRequirement(context))
.withRequirement(new MasterSecretRequirement(context)) .withRequirement(new MasterSecretRequirement(context))
@ -69,7 +69,8 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje
.withPersistence() .withPersistence()
.create()); .create());
this.address = address.serialize(); if (address != null) this.address = address.serialize();
else this.address = null;
} }
@Override @Override