Pārlūkot izejas kodu

add empty slice return

Stefan McShane 3 gadi atpakaļ
vecāks
revīzija
e72865413c

+ 6 - 0
api/server/handlers/project_integration/list_aws.go

@@ -72,5 +72,11 @@ func (p *ListAWSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 		res = append(res, awsInt.ToAWSIntegrationType())
 		res = append(res, awsInt.ToAWSIntegrationType())
 	}
 	}
 
 
+	if len(awsInts) == 0 {
+		// so that the datatype stays the same on all returns
+		p.WriteResult(w, r, []*types.AWSIntegration{})
+		return
+	}
+
 	p.WriteResult(w, r, res)
 	p.WriteResult(w, r, res)
 }
 }