Skip to content

Commit

Permalink
Do not allow adding unknown categories (#3110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Apr 8, 2023
1 parent aec9a5f commit 828f698
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/hacs/websocket/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ async def hacs_repositories_add(
if renamed := hacs.common.renamed_repositories.get(repository):
repository = renamed

if not hacs.repositories.get_by_full_name(repository):
if category not in hacs.common.categories:
hacs.log.error("%s is not a valid category for %s", category, repository)

elif not hacs.repositories.get_by_full_name(repository):
try:
await hacs.async_register_repository(
repository_full_name=repository,
Expand Down

0 comments on commit 828f698

Please sign in to comment.