crash fix

v1.18.x
barisusakli 10 years ago
parent c72c876b04
commit eab180f305

@ -379,7 +379,9 @@ var async = require('async'),
};
Posts.getPostsFields = function(pids, fields, callback) {
pids = pids ? pids : [];
if (!Array.isArray(pids) || !pids.length) {
return callback(null, []);
}
var keys = pids.map(function(pid) {
return 'post:' + pid;

@ -16,6 +16,9 @@ module.exports = function(privileges) {
privileges.posts = {};
privileges.posts.get = function(pids, uid, callback) {
if (!Array.isArray(pids) || !pids.length) {
return callback(null, []);
}
async.parallel({
manage_content: function(next) {
helpers.hasEnoughReputationFor('privileges:manage_content', uid, next);

Loading…
Cancel
Save