fix: don't crash if tid is falsy

This commit is contained in:
Barış Soner Uşaklı
2021-11-30 15:47:19 -05:00
parent 0414356cf7
commit 1cdb0b1e19
2 changed files with 9 additions and 1 deletions

View File

@@ -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, []);
});
});
});