Skip to content

Commit

Permalink
nil panic?
Browse files Browse the repository at this point in the history
Change-Id: If3860e6180aa597b07e927d2c99b62cd6d07711c
  • Loading branch information
seankhliao committed Nov 16, 2024
1 parent 1cecbe4 commit 13a9d7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion earbug/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ func (a *App) backfillAudioFeatures() time.Duration {
}
a.store.Do(ctx, func(s *earbugv5.Store) {
for _, feat := range trackFeatures {
track := s.Tracks[feat.ID.String()]
trackID := feat.ID.String()
track, ok := s.Tracks[trackID]
if !ok {
a.o.L.LogAttrs(ctx, slog.LevelWarn, "got audio features for unknown track", slog.Any("features", feat))
continue
}
track.Features = &earbugv5.AudioFeatures{
Acousticness: ptr(feat.Acousticness),
Danceability: ptr(feat.Danceability),
Expand Down

0 comments on commit 13a9d7a

Please sign in to comment.