3
0
mirror of https://github.com/ergochat/ergo.git synced 2026-03-23 23:58:10 +01:00

fix (*SQLite).ListChannels

If the final channel we attempted to list had no messages, sql.ErrNoRows
would be returned as the error for the entire function, which would
prevent any channels from appearing in the targets list.
This commit is contained in:
Shivaram Lingamneni 2026-03-20 04:12:49 +00:00
parent e6b55903f0
commit f9a11db153

View File

@ -998,7 +998,7 @@ func (s *SQLite) ListChannels(cfchannels []string) (results []history.TargetList
results = make([]history.TargetListing, 0, len(cfchannels))
for _, chname := range cfchannels {
var nanotime int64
err = s.selectChannelTime.QueryRowContext(ctx, chname).Scan(&nanotime)
err := s.selectChannelTime.QueryRowContext(ctx, chname).Scan(&nanotime)
if err == sql.ErrNoRows {
continue // channel has no messages, skip it
}