Fix crash when sending while account is logging in

This commit is contained in:
Michal Horejsek
2021-01-06 15:41:39 +01:00
parent 9fe3718d3f
commit 8fe042218c
2 changed files with 8 additions and 1 deletions

View File

@ -63,5 +63,11 @@ func newBridgeUserWrap(bridgeUser *users.User) *bridgeUserWrap {
}
func (u *bridgeUserWrap) GetStore() storeUserProvider {
return u.User.GetStore()
// We need to explicitly return nil otherwise it's wrapped nil
// and condition `store == nil` would fail.
store := u.User.GetStore()
if store == nil {
return nil
}
return store
}