Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphJACK committed Jul 4, 2023
1 parent 0c3a71d commit 5b2cea3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meta/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b2cea3

Please sign in to comment.