@@ -878,24 +878,13 @@ func (impl *CdHandlerImpl) FetchAppDeploymentStatusForEnvironments(request resou
878
878
objects := impl .enforcerUtil .GetAppAndEnvObjectByPipelineIds (pipelineIds )
879
879
pipelineIds = []int {}
880
880
for _ , object := range objects {
881
- // Safety check to prevent index out of range panic
882
- if len (object ) >= 2 {
883
- appObjectArr = append (appObjectArr , object [0 ])
884
- envObjectArr = append (envObjectArr , object [1 ])
885
- } else {
886
- impl .Logger .Warnw ("skipping object with insufficient elements" , "object" , object )
887
- }
881
+ appObjectArr = append (appObjectArr , object [0 ])
882
+ envObjectArr = append (envObjectArr , object [1 ])
888
883
}
889
884
appResults , envResults := request .CheckAuthBatch (token , appObjectArr , envObjectArr )
890
885
for _ , pipeline := range cdPipelines {
891
- // Safety check to prevent index out of range panic
892
- objectArr , ok := objects [pipeline .Id ]
893
- if ! ok || len (objectArr ) < 2 {
894
- impl .Logger .Warnw ("skipping pipeline with missing object data" , "pipelineId" , pipeline .Id )
895
- continue
896
- }
897
- appObject := objectArr [0 ]
898
- envObject := objectArr [1 ]
886
+ appObject := objects [pipeline .Id ][0 ]
887
+ envObject := objects [pipeline .Id ][1 ]
899
888
if ! (appResults [appObject ] && envResults [envObject ]) {
900
889
// if user unauthorized, skip items
901
890
continue
0 commit comments