diff --git a/internal/handlers/conflicts.go b/internal/handlers/conflicts.go index d3acdb2..446ca46 100644 --- a/internal/handlers/conflicts.go +++ b/internal/handlers/conflicts.go @@ -316,8 +316,12 @@ func (h *ConflictHandler) applyProgressResolution(mediaItemID pgtype.UUID, userI characterOffset = pgtype.Int8{Int64: int64(c), Valid: true} } - currentPage := existingProgress.CurrentPage - totalPages := existingProgress.TotalPages + var currentPage pgtype.Int4 + var totalPages pgtype.Int4 + if err == nil { + currentPage = existingProgress.CurrentPage + totalPages = existingProgress.TotalPages + } if p, ok := data["page"].(float64); ok { currentPage = pgtype.Int4{Int32: int32(p), Valid: true} @@ -661,8 +665,12 @@ func (h *ConflictHandler) applyResolution(mediaItemID pgtype.UUID, userID pgtype characterOffset = pgtype.Int8{Int64: int64(c), Valid: true} } - currentPage := existingProgress.CurrentPage - totalPages := existingProgress.TotalPages + var currentPage pgtype.Int4 + var totalPages pgtype.Int4 + if err == nil { + currentPage = existingProgress.CurrentPage + totalPages = existingProgress.TotalPages + } if p, ok := data["page"].(float64); ok { currentPage = pgtype.Int4{Int32: int32(p), Valid: true}