diff --git a/package.json b/package.json index d3cb070060..bd436082f9 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "rss": "^1.0.0", "semver": "^5.0.1", "serve-favicon": "^2.1.5", - "sitemap": "^1.0.0", + "sitemap": "^1.4.0", "socket.io": "^1.2.1", "socket.io-client": "^1.2.1", "socket.io-redis": "^0.1.3", diff --git a/src/controllers/index.js b/src/controllers/index.js index 3b364ebf9e..fec9b23c01 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -168,7 +168,10 @@ Controllers.sitemap = function(req, res, next) { var sitemap = require('../sitemap.js'); - sitemap.render(function(xml) { + sitemap.render(function(err, xml) { + if (err) { + return next(err); + } res.header('Content-Type', 'application/xml'); res.send(xml); });