Skip to content

Commit

Permalink
Added nil pointer check in smContext update Xn handover
Browse files Browse the repository at this point in the history
Signed-off-by: Jayaram R <[email protected]>
  • Loading branch information
JayaramRCDAC authored and gab-arrobo committed Sep 23, 2024
1 parent 5fcad61 commit 00b3339
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions consumer/sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ func SendUpdateSmContextXnHandover(
ue *amf_context.AmfUe, smContext *amf_context.SmContext, n2SmType models.N2SmInfoType, N2SmInfo []byte) (
*models.UpdateSmContextResponse, *models.UpdateSmContextErrorResponse, *models.ProblemDetails, error,
) {
// Check if the smContext is nil to prevent nil pointer dereference
if smContext == nil {
return nil, nil, nil, fmt.Errorf("smContext is nil")
}
updateData := models.SmContextUpdateData{}
if n2SmType != "" {
updateData.N2SmInfoType = n2SmType
Expand Down

0 comments on commit 00b3339

Please sign in to comment.