prevent crash on widget containers

v1.18.x
psychobunny 11 years ago
parent 15773f28f2
commit d89c0d698e

@ -1,3 +1,5 @@
"use strict";
var async = require('async'), var async = require('async'),
winston = require('winston'), winston = require('winston'),
plugins = require('./plugins'), plugins = require('./plugins'),
@ -24,7 +26,7 @@ var async = require('async'),
data: widget.data data: widget.data
}, function(err, html){ }, function(err, html){
if (widget.data.container && widget.data.container.match('{body}')) { if (widget.data.container && widget.data.container.match('{body}')) {
html = templates.prepare(widget.data.container).parse({ html = templates.parse(widget.data.container, {
title: widget.data.title, title: widget.data.title,
body: html body: html
}); });
@ -48,7 +50,7 @@ var async = require('async'),
return callback(err, []); return callback(err, []);
} }
callback(err, JSON.parse(widgets)); callback(err, JSON.parse(widgets));
}) });
}; };
Widgets.setArea = function(area, callback) { Widgets.setArea = function(area, callback) {

Loading…
Cancel
Save