summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/health-api-common
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/health-api-common')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
index c1532cd35..dfbacdbd3 100644
--- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
@@ -77,6 +77,13 @@ open class HealthCheckProperties {
}
private fun getServiceEndpoint(serviceEndpointInfo: List<String>): ServiceEndpoint {
+ // Ensure the list has at least 2 elements
+ if (serviceEndpointInfo.size < 2) {
+ // Use default values if the list is too short
+ return ServiceEndpoint("", "")
+ }
+
+ // Safely access elements assuming the list has at least 2 elements
return ServiceEndpoint(
removeSpecialCharacter(serviceEndpointInfo[0]), removeSpecialCharacter(serviceEndpointInfo[1])
)