Skip to content

Commit

Permalink
fix(tmdb): nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
varoOP committed Sep 20, 2023
1 parent 3ae1252 commit 75e168e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/domain/tmdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@ func (am *AnimeMovies) Get(path string) error {

func UpdateMaster(am1 *AnimeMovies, am2 *AnimeMovies, path string) {
err := am1.Get(path)
if err.Error() == "file does not exist" {
am2.Store(path)
if err != nil {
if err.Error() == "file does not exist" {
am2.Store(path)
}
return
}

malidToTmdbid := make(map[int]int)
malidToTmdbid := map[int]int{}
for i := range am1.AnimeMovie {
if am1.AnimeMovie[i].TMDBID != 0 {
malidToTmdbid[am1.AnimeMovie[i].MALID] = am1.AnimeMovie[i].TMDBID
Expand Down

0 comments on commit 75e168e

Please sign in to comment.