Skip to content

Commit

Permalink
fix: crash with slice 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos committed Jul 18, 2024
1 parent 01900fb commit 399b63e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controller/serverset/serverset.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (e *external) populateReplicasStatuses(ctx context.Context, cr *v1alpha1.Se
identifier := substitution.Identifier(getNameFrom(cr.Spec.ForProvider.BootVolumeTemplate.Metadata.Name, i, volumeVersion))
if stateMapVal, exists := globalStateMap[cr.Name]; exists {
stateSlice := stateMapVal.GetByIdentifier(identifier)
if len(stateSlice) > 0 && substIndex > len(stateSlice)-1 {
if len(stateSlice) > 0 && substIndex < len(stateSlice)-1 {
val := stateSlice[substIndex].Value
if val != "" {
cr.Status.AtProvider.ReplicaStatuses[i].SubstitutionReplacement[subst.Key] = val
Expand Down

0 comments on commit 399b63e

Please sign in to comment.