diff --git a/main.go b/main.go index c86041a..154aa49 100644 --- a/main.go +++ b/main.go @@ -1080,6 +1080,11 @@ func getSiteMap(c *gin.Context) { return } + if res == nil { + _ = c.AbortWithError(http.StatusNotFound, fmt.Errorf("sitemap does not exist")) + return + } + c.Data(http.StatusOK, "application/xml", res) }