Skip to content

Commit

Permalink
Add nil checks in identify (stashapp#3905)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Jul 12, 2023
1 parent c1352f9 commit 3e810cf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/identify/identify.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,10 @@ func (t *SceneIdentifier) getSceneUpdater(ctx context.Context, s *models.Scene,
scene: s,
result: result,
fieldOptions: fieldOptions,
skipSingleNamePerformers: *options.SkipSingleNamePerformers,
skipSingleNamePerformers: utils.IsTrue(options.SkipSingleNamePerformers),
}

setOrganized := false
if options.SetOrganized != nil {
setOrganized = *options.SetOrganized
}
setOrganized := utils.IsTrue(options.SetOrganized)
ret.Partial = getScenePartial(s, scraped, fieldOptions, setOrganized)

studioID, err := rel.studio(ctx)
Expand Down Expand Up @@ -223,7 +220,7 @@ func (t *SceneIdentifier) getSceneUpdater(ctx context.Context, s *models.Scene,
if err != nil {
return nil, err
}
if addSkipSingleNamePerformerTag {
if addSkipSingleNamePerformerTag && options.SkipSingleNamePerformerTag != nil {
tagID, err := strconv.ParseInt(*options.SkipSingleNamePerformerTag, 10, 64)
if err != nil {
return nil, fmt.Errorf("error converting tag ID %s: %w", *options.SkipSingleNamePerformerTag, err)
Expand All @@ -249,7 +246,7 @@ func (t *SceneIdentifier) getSceneUpdater(ctx context.Context, s *models.Scene,
}
}

if options.SetCoverImage != nil && *options.SetCoverImage {
if utils.IsTrue(options.SetCoverImage) {
ret.CoverImage, err = rel.cover(ctx)
if err != nil {
return nil, err
Expand Down

0 comments on commit 3e810cf

Please sign in to comment.