diff --git a/meta/search.go b/meta/search.go index 455711c..2e70960 100644 --- a/meta/search.go +++ b/meta/search.go @@ -29,8 +29,12 @@ func initSearchIndex() error { lock.RLock() defer lock.RUnlock() - _ = tracksSearchIdx.Close() - _ = albumsSearchIdx.Close() + if tracksSearchIdx != nil { + _ = tracksSearchIdx.Close() + } + if albumsSearchIdx != nil { + _ = albumsSearchIdx.Close() + } mapping := bleve.NewIndexMapping() tracksSearchIdx, err = bleve.New("", mapping)