diff --git a/sdk/src/azure/core/az_mqtt5_connection_hfsm.c b/sdk/src/azure/core/az_mqtt5_connection_hfsm.c index 6bcb9443e1..e74857c8a3 100644 --- a/sdk/src/azure/core/az_mqtt5_connection_hfsm.c +++ b/sdk/src/azure/core/az_mqtt5_connection_hfsm.c @@ -112,9 +112,11 @@ AZ_INLINE az_result _connect(az_mqtt5_connection* me) _az_PRECONDITION_VALID_SPAN(me->_internal.options.client_id_buffer, 1, false); _az_PRECONDITION_VALID_SPAN(me->_internal.options.username_buffer, 1, false); _az_PRECONDITION_VALID_SPAN(me->_internal.options.password_buffer, 0, true); - _az_PRECONDITION_NOT_NULL(me->_internal.options.client_certificates); - _az_PRECONDITION_VALID_SPAN(me->_internal.options.client_certificates[0].cert, 1, false); - _az_PRECONDITION_VALID_SPAN(me->_internal.options.client_certificates[0].key, 1, false); + if (me->_internal.options.client_certificates != NULL) + { + _az_PRECONDITION_VALID_SPAN(me->_internal.options.client_certificates[0].cert, 1, false); + _az_PRECONDITION_VALID_SPAN(me->_internal.options.client_certificates[0].key, 1, false); + } az_mqtt5_connect_data connect_data = (az_mqtt5_connect_data){ .host = me->_internal.options.hostname,