Skip to content

Commit

Permalink
Check for null user
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed Jul 28, 2024
1 parent beb5e59 commit 24b42e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/webserver/controller/highlight/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (h *Controller) List(c *fiber.Ctx) error {
return fiber.ErrInternalServerError
}

if user == nil {
return fiber.ErrNotFound
}

docsSortedByHighlightedDate, err := h.hlRepository.Highlights(int(user.ID), page, model.ResultsPerPage)
if err != nil {
return fiber.ErrInternalServerError
Expand Down

0 comments on commit 24b42e2

Please sign in to comment.