fix: check nil pointer in saveProfileShowcasePreferencesProto (#4821)
This commit is contained in:
parent
9fef2d3558
commit
f0dcc60a17
|
@ -181,7 +181,9 @@ func (m *Messenger) handleBackedUpProfile(message *protobuf.BackedUpProfile, bac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
response.SetProfileShowcasePreferences(profileShowcasePreferences)
|
if profileShowcasePreferences != nil {
|
||||||
|
response.SetProfileShowcasePreferences(profileShowcasePreferences)
|
||||||
|
}
|
||||||
|
|
||||||
var ensUsernameDetails []*ensservice.UsernameDetail
|
var ensUsernameDetails []*ensservice.UsernameDetail
|
||||||
for _, d := range message.EnsUsernameDetails {
|
for _, d := range message.EnsUsernameDetails {
|
||||||
|
|
|
@ -669,6 +669,9 @@ func (m *Messenger) DeleteProfileShowcaseCommunity(community *communities.Commun
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Messenger) saveProfileShowcasePreferencesProto(p *protobuf.SyncProfileShowcasePreferences, shouldSync bool) (*identity.ProfileShowcasePreferences, error) {
|
func (m *Messenger) saveProfileShowcasePreferencesProto(p *protobuf.SyncProfileShowcasePreferences, shouldSync bool) (*identity.ProfileShowcasePreferences, error) {
|
||||||
|
if p == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
preferences := FromProfileShowcasePreferencesProto(p)
|
preferences := FromProfileShowcasePreferencesProto(p)
|
||||||
return preferences, m.setProfileShowcasePreferences(preferences, shouldSync)
|
return preferences, m.setProfileShowcasePreferences(preferences, shouldSync)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue