From d28fb153c7dd9eecf29bfe1c9458139acae873c8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 18 Dec 2014 19:22:59 -0500 Subject: [PATCH] closes #2537 --- src/routes/api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/api.js b/src/routes/api.js index a73f663656..c3d011e1e2 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -154,7 +154,13 @@ function getTemplatesListing(req, res, next) { if (err) { return next(err); } - config = JSON.parse(config.toString()); + + try { + config = JSON.parse(config.toString()); + } catch (err) { + return next(err); + } + plugins.fireHook('filter:templates.get_config', config, next); }); },