Skip to content

Commit

Permalink
fix client validation order
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed May 15, 2024
1 parent ec2d22f commit 5a78a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/v5/mqtt5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2190,12 +2190,12 @@ static int s_aws_mqtt5_client_change_desired_state(
struct aws_mqtt5_client *client,
enum aws_mqtt5_client_state desired_state,
struct aws_mqtt5_operation_disconnect *disconnect_operation) {
AWS_FATAL_ASSERT(client->loop != NULL);
AWS_FATAL_ASSERT(disconnect_operation == NULL || desired_state == AWS_MCS_STOPPED);

if (client == NULL) {
return aws_raise_error(AWS_ERROR_MQTT5_CLIENT_TERMINATED);
}
AWS_FATAL_ASSERT(client->loop != NULL);
AWS_FATAL_ASSERT(disconnect_operation == NULL || desired_state == AWS_MCS_STOPPED);

if (!s_is_valid_desired_state(desired_state)) {
AWS_LOGF_ERROR(
Expand Down

0 comments on commit 5a78a56

Please sign in to comment.