Skip to content

Commit

Permalink
fix(api-gql): check on nil hideTimeout for nowplaying overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Jun 11, 2024
1 parent d2a72b8 commit 608b2d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/api-gql/internal/gql/resolvers/overlays.resolver.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ func (r *mutationResolver) createNowPlayingOverlay(
}

if opts.HideTimeout.IsSet() {
entity.HideTimeout = null.IntFrom(int64(*opts.HideTimeout.Value()))
if opts.HideTimeout.Value() == nil {
entity.HideTimeout = null.Int{}
} else {
entity.HideTimeout = null.IntFrom(int64(*opts.HideTimeout.Value()))
}
}

if err := r.gorm.
Expand Down Expand Up @@ -473,7 +477,11 @@ func (r *mutationResolver) updateNowPlayingOverlay(
}

if opts.HideTimeout.IsSet() {
entity.HideTimeout = null.IntFrom(int64(*opts.HideTimeout.Value()))
if opts.HideTimeout.Value() == nil {
entity.HideTimeout = null.Int{}
} else {
entity.HideTimeout = null.IntFrom(int64(*opts.HideTimeout.Value()))
}
}

if err := r.gorm.
Expand Down

0 comments on commit 608b2d9

Please sign in to comment.