Thanks Thomasz. That was a amazing bug: 

- Our unit tests covered every line here
- we had succesfull unit tests which covered the functionality of deleting empty dir's (they worked because of the removedEmptyParents() call outside the loop)
- the code went through multiple reviews

... and still this bug managed to be undetected. Good job.