diff --git a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/analytics/SynapseAnalyticsDataProvider.java b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/analytics/SynapseAnalyticsDataProvider.java index 41dbae64eb99..7dea8bfca460 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/analytics/SynapseAnalyticsDataProvider.java +++ b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/analytics/SynapseAnalyticsDataProvider.java @@ -311,7 +311,7 @@ public String getUserName() { if (messageContext.getPropertyKeySet().contains(APIMgtGatewayConstants.END_USER_NAME)) { return (String) messageContext.getProperty(APIMgtGatewayConstants.END_USER_NAME); } - if (messageContext.getPropertyKeySet().contains(APIMgtGatewayConstants.USER_ID)) { + else if (messageContext.getPropertyKeySet().contains(APIMgtGatewayConstants.USER_ID)) { return (String) messageContext.getProperty(APIMgtGatewayConstants.USER_ID); } return null;