Skip to content

Commit

Permalink
don't panic on savedfilters with id nil
Browse files Browse the repository at this point in the history
  • Loading branch information
o-fl0w committed Nov 18, 2023
1 parent 8a9b090 commit 759505e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/stash/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ func FindSavedFilterIdsByFrontPage(ctx context.Context, client graphql.Client) (
log.Ctx(ctx).Debug().Msg("Filter skipped: Predefined filter on front page: Only user created saved scene filters are supported.")
continue
}
if typeName != "SavedFilter" {
fid := filter["savedFilterId"]
if typeName != "SavedFilter" || fid == nil {
log.Ctx(ctx).Debug().Str("type", typeName).Msg("Filter skipped: Filter of unsupported type on front page: Only user created saved scene filters are supported")
continue
}

filterId := strconv.Itoa(int(filter["savedFilterId"].(float64)))
filterId := strconv.Itoa(int(fid.(float64)))
filterIds = append(filterIds, filterId)
}

Expand Down

0 comments on commit 759505e

Please sign in to comment.