Skip to content

Commit 3d1e1d3

Browse files
committed
fix: handle case when no PCF is found in PCFSelection
1 parent 9cfa88c commit 3d1e1d3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/sbi/consumer/nrf_service.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ func (s *nnrfService) PCFSelection(smContext *smf_context.SMContext) error {
446446
}
447447

448448
// Select PCF from available PCF
449-
449+
if res == nil || len(res.SearchResult.NfInstances) == 0 {
450+
return fmt.Errorf("no PCF found in PCFSelection")
451+
}
450452
smContext.SelectedPCFProfile = res.SearchResult.NfInstances[0]
451453

452454
return nil

0 commit comments

Comments
 (0)