Skip to content

Commit 51033d1

Browse files
reki9185ianchen0119
authored andcommitted
fix: add range check
1 parent 7afb31c commit 51033d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/sbi/consumer/smf_service.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ func (s *nsmfService) SendCreateSmContextRequest(ue *amf_context.AmfUe, smContex
177177
location := postSmContextReponse.Location
178178

179179
parts := strings.Split(location, "/")
180-
location = parts[len(parts)-1]
180+
181+
if len(parts) > 0 {
182+
location = parts[len(parts)-1]
183+
}
181184

182185
smContextRef = "urn:uuid:" + location
183186
} else {

0 commit comments

Comments
 (0)