Skip to content

Commit

Permalink
Added nil pointer check in smContext update Xn handover (#306)
Browse files Browse the repository at this point in the history
Signed-off-by: Jayaram R <[email protected]>
Co-authored-by: Ajay Lotan Thakur <[email protected]>
  • Loading branch information
JayaramRCDAC and thakurajayL authored Sep 27, 2024
1 parent 61c8b31 commit ab78eb3
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 ab78eb3

Please sign in to comment.