#vulnerable code 
                                protected void onClose(final MqttEndpoint endpoint) {
        metrics.decrementMqttConnections(getCredentials(endpoint.auth()).getTenantId());
    } 
                            #location 2 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                protected void onClose(final MqttEndpoint endpoint) {
    }