Fix the crash in #69

This commit is contained in:
Tulir Asokan
2019-06-13 21:30:38 +03:00
parent 2bc0e52250
commit 5be78dd978
2 changed files with 6 additions and 0 deletions

View File

@ -107,6 +107,9 @@ func (bridge *Bridge) dbPuppetsToPuppets(dbPuppets []*database.Puppet) []*Puppet
defer bridge.puppetsLock.Unlock()
output := make([]*Puppet, len(dbPuppets))
for index, dbPuppet := range dbPuppets {
if dbPuppet == nil {
continue
}
puppet, ok := bridge.puppets[dbPuppet.JID]
if !ok {
puppet = bridge.NewPuppet(dbPuppet)