Fixed: Prevent delete of last profile

This commit is contained in:
Qstick
2022-03-25 18:53:29 -05:00
parent 627da14a32
commit 69de6d18eb
2 changed files with 4 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ namespace NzbDrone.Core.Profiles
public void Delete(int id)
{
if (_indexerFactory.All().Any(c => c.AppProfileId == id))
if (_indexerFactory.All().Any(c => c.AppProfileId == id) || All().Count == 1)
{
throw new ProfileInUseException(id);
}