mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-13 17:13:11 +01:00
Fix the crash in #69
This commit is contained in:
parent
2bc0e52250
commit
5be78dd978
2 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,9 @@ func (bridge *Bridge) dbPortalsToPortals(dbPortals []*database.Portal) []*Portal
|
||||||
defer bridge.portalsLock.Unlock()
|
defer bridge.portalsLock.Unlock()
|
||||||
output := make([]*Portal, len(dbPortals))
|
output := make([]*Portal, len(dbPortals))
|
||||||
for index, dbPortal := range dbPortals {
|
for index, dbPortal := range dbPortals {
|
||||||
|
if dbPortal == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
portal, ok := bridge.portalsByJID[dbPortal.Key]
|
portal, ok := bridge.portalsByJID[dbPortal.Key]
|
||||||
if !ok {
|
if !ok {
|
||||||
portal = bridge.loadDBPortal(dbPortal, nil)
|
portal = bridge.loadDBPortal(dbPortal, nil)
|
||||||
|
|
|
@ -107,6 +107,9 @@ func (bridge *Bridge) dbPuppetsToPuppets(dbPuppets []*database.Puppet) []*Puppet
|
||||||
defer bridge.puppetsLock.Unlock()
|
defer bridge.puppetsLock.Unlock()
|
||||||
output := make([]*Puppet, len(dbPuppets))
|
output := make([]*Puppet, len(dbPuppets))
|
||||||
for index, dbPuppet := range dbPuppets {
|
for index, dbPuppet := range dbPuppets {
|
||||||
|
if dbPuppet == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
puppet, ok := bridge.puppets[dbPuppet.JID]
|
puppet, ok := bridge.puppets[dbPuppet.JID]
|
||||||
if !ok {
|
if !ok {
|
||||||
puppet = bridge.NewPuppet(dbPuppet)
|
puppet = bridge.NewPuppet(dbPuppet)
|
||||||
|
|
Loading…
Reference in a new issue