Skip to content

Commit

Permalink
fix(prov-dev): Fix bug where sync overload of register ignores additi…
Browse files Browse the repository at this point in the history
…onal data (#1732)

#1731
  • Loading branch information
timtay-microsoft authored Jul 21, 2023
1 parent bd079a6 commit b273bcc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ public void registerDevice(ProvisioningDeviceClientRegistrationCallback provisio
throw new IllegalArgumentException("registration callback cannot be null");
}

this.provisioningDeviceClientConfig.setPayload(additionalData.getProvisioningPayload());
if (additionalData != null)
{
this.provisioningDeviceClientConfig.setPayload(additionalData.getProvisioningPayload());
}

this.provisioningDeviceClientConfig.setRegistrationCallback(provisioningDeviceClientRegistrationCallback, context);

Expand Down Expand Up @@ -180,7 +183,8 @@ public ProvisioningDeviceClientRegistrationResult registerDeviceSync(AdditionalD
registrationExceptionReference.set(e);
registrationLatch.countDown();
},
null);
null,
additionalData);

// Wait until registration finishes or for a max amount of time
boolean timedOut = !registrationLatch.await(timeout, TimeUnit.SECONDS);
Expand Down

0 comments on commit b273bcc

Please sign in to comment.