you are also returning ``null`` if the path is invalid currently, not only if it is empty