I'd check path for nullptr before getting it into std::string