Fix possible panic in contacts fetch (#5205)
We were not checking for the error returned by the Get method before trying to use the result to get contact info. <!-- PR description--> --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
f92f811559
commit
f0b8041c3f
@ -186,8 +186,11 @@ func (c Contacts) GetItem(
|
||||
Contacts().
|
||||
ByContactId(itemID).
|
||||
Get(ctx, options)
|
||||
if err != nil {
|
||||
return nil, nil, clues.Stack(err)
|
||||
}
|
||||
|
||||
return cont, ContactInfo(cont), clues.Stack(err).OrNil()
|
||||
return cont, ContactInfo(cont), nil
|
||||
}
|
||||
|
||||
func (c Contacts) PostItem(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user