Avoid empty string issue
This commit is contained in:
@@ -47,7 +47,7 @@ bool ScreenshotUtil::saveFramebufferAsBmp(const char* filename, const uint8_t* f
|
|||||||
size_t last_slash = path.find_last_of('/');
|
size_t last_slash = path.find_last_of('/');
|
||||||
if (last_slash != std::string::npos) {
|
if (last_slash != std::string::npos) {
|
||||||
std::string dir = path.substr(0, last_slash);
|
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())) {
|
if (!Storage.mkdir(dir.c_str())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user