Skip to content

Node.js based forum software built for the modern web

check sortBy

Baris Usaklibcf2156028e3
diff --git a/src/search.js b/src/search.js
index 4ad633438f..6e194c37be 100644
--- a/src/search.js
+++ b/src/search.js
@@ -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;
});