aboutsummaryrefslogtreecommitdiff
path: root/src/FATStorage.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2021-10-28 23:48:20 +0200
committerArisotura <thetotalworm@gmail.com>2021-10-28 23:48:20 +0200
commit8b59c73c01e78271124e688825859c9df82e37c7 (patch)
treeb9d2f7b2cc275a8183fecdad864e14e6d3d6c2c6 /src/FATStorage.cpp
parentd25102a9c8fb30977dbc7df069bb80610bd6eed6 (diff)
also don't try to save if there's no folder to sync to
Diffstat (limited to 'src/FATStorage.cpp')
-rw-r--r--src/FATStorage.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/FATStorage.cpp b/src/FATStorage.cpp
index 07ef256..df2974f 100644
--- a/src/FATStorage.cpp
+++ b/src/FATStorage.cpp
@@ -949,7 +949,10 @@ bool FATStorage::Load(std::string filename, u64 size, std::string sourcedir)
if (hasdir)
{
if (!fs::is_directory(fs::u8path(sourcedir)))
+ {
hasdir = false;
+ SourceDir = "";
+ }
}
// 'auto' size management: (size=0)
@@ -1082,6 +1085,11 @@ bool FATStorage::Load(std::string filename, u64 size, std::string sourcedir)
bool FATStorage::Save()
{
+ if (SourceDir.empty())
+ {
+ return true;
+ }
+
FF_File = Platform::OpenLocalFile(FilePath.c_str(), "r+b");
if (!FF_File)
{