diff --git a/src/util/ScreenshotUtil.cpp b/src/util/ScreenshotUtil.cpp index 0f14f506..67d16f00 100644 --- a/src/util/ScreenshotUtil.cpp +++ b/src/util/ScreenshotUtil.cpp @@ -47,7 +47,7 @@ bool ScreenshotUtil::saveFramebufferAsBmp(const char* filename, const uint8_t* f size_t last_slash = path.find_last_of('/'); if (last_slash != std::string::npos) { std::string dir = path.substr(0, last_slash); - if (!Storage.exists(dir.c_str())) { + if (!dir.empty() && !Storage.exists(dir.c_str())) { if (!Storage.mkdir(dir.c_str())) { return false; }