mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
fix: don't crash if tid is falsy
This commit is contained in:
@@ -502,6 +502,11 @@ describe('Topic\'s', () => {
|
||||
assert.strictEqual(post.index, index);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return empty array if first param is falsy', async () => {
|
||||
const posts = await topics.getTopicPosts(null, `tid:${tid}:posts`, 0, 9, topic.userId, true);
|
||||
assert.deepStrictEqual(posts, []);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user