fix(requests): ignore nil presence backfill repo

This commit is contained in:
Silo Server Migration
2026-05-24 22:50:06 -04:00
parent 1339b9b5c9
commit 8b76dc0bf2
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ type CatalogPresence struct {
func NewCatalogPresence(items *catalog.ItemRepository, providerIDs ...*catalog.ProviderIDRepository) *CatalogPresence {
var backfill tmdbBackfiller
if len(providerIDs) > 0 {
if len(providerIDs) > 0 && providerIDs[0] != nil {
backfill = providerIDs[0]
}
return &CatalogPresence{items: items, tmdbBackfill: backfill}
+7
View File
@@ -82,3 +82,10 @@ func TestCatalogPresenceKeepsLookupTMDBCompatibility(t *testing.T) {
t.Fatalf("lookup candidates = %+v, want tmdb candidate", lookup.got)
}
}
func TestNewCatalogPresenceIgnoresNilBackfiller(t *testing.T) {
presence := NewCatalogPresence(nil, nil)
if presence.tmdbBackfill != nil {
t.Fatalf("tmdbBackfill = %#v, want nil", presence.tmdbBackfill)
}
}