I think it'll be more efficient if the check is built into get_target_path. The latter should always return a valid path anyway.