Skip to content

Commit cbeaaf9

Browse files
committed
Only include non-null sessions when listing megolm sessions
1 parent 24d2cce commit cbeaaf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crypto/sql_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (store *SQLCryptoStore) scanGroupSessionList(rows *sql.Rows) (result []*Inb
334334
func (store *SQLCryptoStore) GetGroupSessionsForRoom(roomID id.RoomID) ([]*InboundGroupSession, error) {
335335
rows, err := store.DB.Query(`
336336
SELECT room_id, signing_key, sender_key, session, forwarding_chains
337-
FROM crypto_megolm_inbound_session WHERE room_id=$1 AND account_id=$2`,
337+
FROM crypto_megolm_inbound_session WHERE room_id=$1 AND account_id=$2 AND session IS NOT NULL`,
338338
roomID, store.AccountID,
339339
)
340340
if err == sql.ErrNoRows {
@@ -348,7 +348,7 @@ func (store *SQLCryptoStore) GetGroupSessionsForRoom(roomID id.RoomID) ([]*Inbou
348348
func (store *SQLCryptoStore) GetAllGroupSessions() ([]*InboundGroupSession, error) {
349349
rows, err := store.DB.Query(`
350350
SELECT room_id, signing_key, sender_key, session, forwarding_chains
351-
FROM crypto_megolm_inbound_session WHERE account_id=$2`,
351+
FROM crypto_megolm_inbound_session WHERE account_id=$2 AND session IS NOT NULL`,
352352
store.AccountID,
353353
)
354354
if err == sql.ErrNoRows {

0 commit comments

Comments
 (0)