From 026aa3935bc55dac67e87e12db58d0b703eca302 Mon Sep 17 00:00:00 2001 From: Joel Damata Date: Sat, 5 Oct 2024 17:31:56 -0400 Subject: [PATCH] issues/248 --- sonarqube/resource_sonarqube_project.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sonarqube/resource_sonarqube_project.go b/sonarqube/resource_sonarqube_project.go index 788a390f..b61d7fff 100644 --- a/sonarqube/resource_sonarqube_project.go +++ b/sonarqube/resource_sonarqube_project.go @@ -231,11 +231,13 @@ func resourceSonarqubeProjectRead(d *schema.ResourceData, m interface{}) error { } settings := make([]interface{}, len(componentSettings)) - for i, s := range componentSettings { - key := s.(map[string]interface{})["key"].(string) - for _, apiSetting := range projectSettings { - if key == apiSetting.Key { - settings[i] = apiSetting.ToMap() + if len(componentSettings) >= 1 { + for i, s := range componentSettings { + key := s.(map[string]interface{})["key"].(string) + for _, apiSetting := range projectSettings { + if key == apiSetting.Key { + settings[i] = apiSetting.ToMap() + } } } }