The standard said that the input parameter `pos` of std::vector::erase must be valid and dereferenceable, the `end()` iterator cannot be used as a value of `pos`. I did some tests and the crash only occurs when the vector is empty. Fortunately `local_files` is usually not empty.