Fix mistake in getting puppets with unknown phone number

This commit is contained in:
Tulir Asokan 2023-07-03 16:16:53 +03:00
parent 6fca366d6a
commit 8ab8504023

View file

@ -67,10 +67,10 @@ func (br *GMBridge) GetPuppetByKey(key database.Key, phone string) *Puppet {
br.ZLog.Err(err).Object("puppet_key", key).Msg("Failed to get puppet from database")
return nil
}
if phone == "" {
return nil
}
if dbPuppet == nil {
if phone == "" {
return nil
}
dbPuppet = br.DB.Puppet.New()
dbPuppet.Key = key
dbPuppet.Phone = phone