If the name attribute for uses-feature or uses-permission is empty the error value is still empty indicating error and preventing the else part from being checked as it should be.