add no rows check

This commit is contained in:
Gabe Farrell 2026-01-16 00:43:50 -05:00
parent 67507513f8
commit 46e216ebf5

View file

@ -60,7 +60,7 @@ func (d *Psql) GetArtist(ctx context.Context, opts db.GetArtistOpts) (*models.Ar
return nil, fmt.Errorf("GetAlbum: GetFirstListenFromArtist: %w", err)
}
rank, err := d.q.GetArtistAllTimeRank(ctx, opts.ID)
if err != nil {
if err != nil && !errors.Is(err, pgx.ErrNoRows) {
return nil, fmt.Errorf("GetArtist: GetArtistAllTimeRank: %w", err)
}
return &models.Artist{