Fixed the addon controller

This commit is contained in:
Mathias Wagner 2022-07-10 00:10:43 +02:00
parent 9231117668
commit 2da6211502
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -35,7 +35,7 @@ module.exports.listAddonsByAuthorName = async (author_name) => {
// Gets an addon by the author and addon name
module.exports.getAddonByName = async (author_name, name) => {
const user = await getUserByName(author_name);
if (user === null) return;
if (user === null) return null;
return await Addon.findOne({author: user._id, name}, {__v: 0}).populate('author', 'username email').collation({locale: "en", strength: 2}).exec();
}