Fix crash when there would be no widgets

This commit is contained in:
MrWaffle
2014-02-20 19:18:23 +01:00
parent 599027f2d3
commit 502886c3b9

View File

@@ -37,6 +37,9 @@ var async = require('async'),
Widgets.getArea = function(template, location, callback) {
db.getObjectField('widgets:' + template, location, function(err, widgets) {
if (!widgets) {
return callback(err, []);
}
callback(err, JSON.parse(widgets));
})
};