There is no reason to check for empty before clearing the vector.

You are always allowed to clear a vector, anonytmouse is correct that the problem is somewhere else in the code.