check sortBy

This commit is contained in:
Baris Usakli
2017-06-08 14:29:14 -04:00
parent f6ba79287b
commit bcf2156028

View File

@@ -182,7 +182,7 @@ function getMatchedPosts(pids, data, callback) {
async.parallel({
teasers: function (next) {
if (data.sortBy.startsWith('teaser')) {
if (data.sortBy && data.sortBy.startsWith('teaser')) {
var teaserKeys = topicsData.map(function (topic) {
return 'post:' + topic.teaserPid;
});