Fix error when queue is empty

This commit is contained in:
Chi Vinh Le
2017-12-19 20:39:41 +01:00
parent 7b92e58ff3
commit 349341400d
@@ -152,6 +152,10 @@ export function cleanUpQueue(root, queue, sortOrder, queueConfig) {
let nodes = root[queue].nodes;
let hasNextPage = root[queue].hasNextPage;
if (!nodes.length) {
return root;
}
if (queueConfig) {
nodes = root[queue].nodes.filter((comment) => commentBelongToQueue(queue, comment, queueConfig));
}