diff --git a/wpiutil/src/main/native/cpp/DataLogBackgroundWriter.cpp b/wpiutil/src/main/native/cpp/DataLogBackgroundWriter.cpp index b20d4b7390..9b7a52c9d0 100644 --- a/wpiutil/src/main/native/cpp/DataLogBackgroundWriter.cpp +++ b/wpiutil/src/main/native/cpp/DataLogBackgroundWriter.cpp @@ -176,7 +176,8 @@ static std::string MakeRandomFilename() { } struct DataLogBackgroundWriter::WriterThreadState { - explicit WriterThreadState(std::string_view dir) : dirPath{dir} {} + explicit WriterThreadState(std::string_view dir) + : dirPath{dir.empty() ? "." : dir} {} WriterThreadState(const WriterThreadState&) = delete; WriterThreadState& operator=(const WriterThreadState&) = delete; ~WriterThreadState() { Close(); }