nodebb-plugin-dbsearch 6.2.4 → 6.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/dbsearch.js +4 -2
  2. package/package.json +1 -1
package/lib/dbsearch.js CHANGED
@@ -273,7 +273,8 @@ async function reIndexTopics() {
273
273
 
274
274
  async function topicsSave(topics) {
275
275
  topics = topics.filter(
276
- t => t && t.tid && parseInt(t.deleted, 10) !== 1 && !pluginConfig.excludeCategories.includes(String(t.cid))
276
+ t => t && utils.isNumber(t.tid) && parseInt(t.deleted, 10) !== 1 &&
277
+ !pluginConfig.excludeCategories.includes(String(t.cid))
277
278
  );
278
279
 
279
280
  let data = topics.map((topicData) => {
@@ -325,7 +326,8 @@ async function reIndexPosts() {
325
326
 
326
327
  async function postsSave(posts) {
327
328
  posts = posts.filter(
328
- p => p && p.pid && parseInt(p.deleted, 10) !== 1 && !pluginConfig.excludeCategories.includes(String(p.cid))
329
+ p => p && utils.isNumber(p.pid) && parseInt(p.deleted, 10) !== 1 &&
330
+ !pluginConfig.excludeCategories.includes(String(p.cid))
329
331
  );
330
332
 
331
333
  let data = posts.map((postData) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-dbsearch",
3
- "version": "6.2.4",
3
+ "version": "6.2.5",
4
4
  "description": "A Plugin that lets users search posts and topics",
5
5
  "main": "index.js",
6
6
  "repository": {