Skip to content

Commit

Permalink
fix(strainsyn.go): correct nil check to prevent potential null pointe…
Browse files Browse the repository at this point in the history
…r exception

The nil check was previously checking the 'Data' field of the 'tac'
object. However, if 'tac' itself was null, this would result in a null
pointer exception. The nil check has been corrected to check 'tac'
instead of 'tac.Data', preventing potential crashes due to null pointer
exceptions.
  • Loading branch information
cybersiddhu committed Apr 23, 2024
1 parent 1f237d1 commit ae46e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/load/stockcenter/strainsyn.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func removeExistingSynonyms(
if err != nil && status.Code(err) != codes.NotFound {
return fmt.Errorf("error in listing synonyms for %s %s", entryId, err)
}
if tac.Data == nil {
if tac == nil {
logger.Debugf("synonym %s is absent, no need to remove it", entryId)
return nil
}
Expand Down

0 comments on commit ae46e90

Please sign in to comment.