Steps to reproduce:
- Navigate to Control Panel > Categories
- Add a vocabulary
- Add a category
- Add a subcategory to the category
- Click on the check box next to the vocabulary, then click Actions > Delete
- This will result in an error message and the exception and stacktrace below.
- If the user clicks on the expand arrow to show the subcategory and then tries to delete, it will delete fine. It seems that it all depends on whether or not the subcategory becomes visible at some point in time.