I covered the case in which a type is deleted from an index, but it doesn't exists.

I simply catch the raised exception. Perhaps not the optimal solution.