diff --git a/src/posts.js b/src/posts.js index c2e252302d..bea7b6673f 100644 --- a/src/posts.js +++ b/src/posts.js @@ -35,6 +35,10 @@ var async = require('async'), }; Posts.getPostsByPids = function(pids, uid, callback) { + if (!Array.isArray(pids) || !pids.length) { + return callback(null, []); + } + var keys = []; for (var x=0, numPids=pids.length; x