diff options
| author | Bobby <[email protected]> | 2026-01-16 11:40:30 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-01-16 11:40:30 +0530 |
| commit | d881e1234f1d42acd0b598fe829fa56ab09cea53 (patch) | |
| tree | fb5d6ea5ceac62909f406e2f7653c525f4b4b6eb /controllers | |
| parent | 57c0b7a7d64f546cf30bfad456962f2d11bb9f3e (diff) | |
| download | metachan-d881e1234f1d42acd0b598fe829fa56ab09cea53.tar.xz metachan-d881e1234f1d42acd0b598fe829fa56ab09cea53.zip | |
Handle missing anime mapping by checking for MAL ID in getAnimeMapping function
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/anime.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/controllers/anime.go b/controllers/anime.go index 83e0039..753effb 100644 --- a/controllers/anime.go +++ b/controllers/anime.go @@ -153,10 +153,11 @@ func getAnimeMapping(c *fiber.Ctx) (*entities.AnimeMapping, error) { } else { mapping, err = database.GetAnimeMappingViaMALID(mappers.ForceInt(malID)) } - if err != nil { + if err != nil || mapping.MAL == 0 { return nil, c.Status(fiber.StatusNotFound).JSON(fiber.Map{ "error": "Anime mapping not found", }) } + return mapping, nil } |
