From 8ab850402350ad14ee9eeab7984d73ee7191ad06 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 3 Jul 2023 16:16:53 +0300 Subject: [PATCH] Fix mistake in getting puppets with unknown phone number --- puppet.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/puppet.go b/puppet.go index 3e5ddc5..3307adc 100644 --- a/puppet.go +++ b/puppet.go @@ -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