From 5a78a56a66659bcab85043d746a6bcbe846d230b Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Wed, 15 May 2024 14:02:15 -0700 Subject: [PATCH] fix client validation order --- source/v5/mqtt5_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/v5/mqtt5_client.c b/source/v5/mqtt5_client.c index b9ac71b9..fa1f817a 100644 --- a/source/v5/mqtt5_client.c +++ b/source/v5/mqtt5_client.c @@ -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(