fix crash on missing file

This commit is contained in:
Niko Abeler 2023-07-27 20:55:50 +02:00
parent 5e77fdd33b
commit 40117dab37
1 changed files with 1 additions and 1 deletions

View File

@ -23,9 +23,9 @@ func (h *MediaHandler) Handle(c *fiber.Ctx) error {
return err
}
binary, err := h.binaryService.FindById(id)
c.Set("Content-Type", binary.Mime())
if err != nil {
return err
}
c.Set("Content-Type", binary.Mime())
return c.Send(binary.Data)
}