Avoid empty string issue

This commit is contained in:
jpirnay
2026-04-09 14:17:24 +02:00
parent 34f85864a1
commit 8bb32d464d
+1 -1
View File
@@ -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;
}