mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
Fix crash when there would be no widgets
This commit is contained in:
@@ -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));
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user