From b9173ba07233a87c052a6ea7ef0d6faf48dd7070 Mon Sep 17 00:00:00 2001 From: danielaloni Date: Wed, 26 Oct 2022 15:22:04 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Create=20new=20device=20if=20pro?= =?UTF-8?q?vided=20an=20empty=20string=20pointer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userapi/storage/shared/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userapi/storage/shared/storage.go b/userapi/storage/shared/storage.go index 0cf713dac..8c128cb9f 100644 --- a/userapi/storage/shared/storage.go +++ b/userapi/storage/shared/storage.go @@ -523,7 +523,7 @@ func (d *Database) CreateDevice( ctx context.Context, localpart string, deviceID *string, accessToken string, displayName *string, ipAddr, userAgent string, ) (dev *api.Device, returnErr error) { - if deviceID != nil { + if deviceID != nil && *deviceID != "" { returnErr = d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error { var err error // Revoke existing tokens for this device