From e959927d0ad20f53c51944abb751b7d40fad6aea Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Mon, 7 Oct 2019 20:15:58 +0800 Subject: [PATCH] selectAccountDataByType shouldn't error when no rows (#804) Signed-off-by: Alex Chen --- clientapi/auth/storage/accounts/account_data_table.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clientapi/auth/storage/accounts/account_data_table.go b/clientapi/auth/storage/accounts/account_data_table.go index 0d6ad093..080ca3f3 100644 --- a/clientapi/auth/storage/accounts/account_data_table.go +++ b/clientapi/auth/storage/accounts/account_data_table.go @@ -125,6 +125,10 @@ func (s *accountDataStatements) selectAccountDataByType( var content []byte if err = stmt.QueryRowContext(ctx, localpart, roomID, dataType).Scan(&content); err != nil { + if err == sql.ErrNoRows { + return nil, nil + } + return }