Skip to content

Commit

Permalink
Small logical fix in MqttTransportHandler (#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
drwill-ms authored Apr 20, 2023
1 parent 51a206f commit 8d6e0ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions iothub/device/src/Pipeline/MqttTransportHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,7 @@ IotHubClientErrorResponseMessage ParseError(byte[] payloadBytes)
// Use the encoder that has been agreed to between the client and service to decode the byte[] response
// The response is deserialized into an SDK-defined type based on service-defined NewtonSoft.Json-based json property name.
// For this reason, we use Newtonsoft.Json serializer for this deserialization.
TwinDocument clientTwinProperties = status == 200
? DefaultPayloadConvention.Instance.GetObject<TwinDocument>(payloadBytes)
: null;
TwinDocument clientTwinProperties = DefaultPayloadConvention.Instance.GetObject<TwinDocument>(payloadBytes);

getTwinResponse.Twin = new TwinProperties(
new DesiredProperties(clientTwinProperties.Desired)
Expand Down

0 comments on commit 8d6e0ca

Please sign in to comment.