Prevent fall through in the model search method when a plugin is specified (#6004)

Signed-off-by: Aleksandr Yackovlev <a.yackovlev@corp.mail.ru>
This commit is contained in:
Alex Yackovlev 2020-05-05 20:38:41 +03:00 committed by GitHub
parent a96d41eeca
commit c9925f3fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,11 +108,11 @@ class DatabaseManager {
return _.get(strapi.admin, ['models', key]);
}
return (
_.get(strapi.plugins, [plugin, 'models', key]) ||
_.get(strapi, ['models', key]) ||
_.get(strapi, ['components', key])
);
if (plugin) {
return _.get(strapi.plugins, [plugin, 'models', key]);
}
return _.get(strapi, ['models', key]) || _.get(strapi, ['components', key]);
}
getModelByCollectionName(collectionName) {