aboutsummaryrefslogtreecommitdiff
path: root/src/common/fs/path_util.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2025-12-04 07:18:36 +0100
committercrueter <crueter@eden-emu.dev>2025-12-04 07:18:36 +0100
commit1b1e186a580984e210519f2bc2969ed3b94dbc20 (patch)
tree66988a2ca7e6109e8e0f40f6e1c507e5b79e7cea /src/common/fs/path_util.cpp
parente75ecfd4a0e5da97526ea5d1bd3d293835b09f91 (diff)
[fs] fix paths not being created due to instance not existing yet (#3134)
basically a check runs that depends on the instance being created, but instance isnt created yet so check fails Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3134 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/common/fs/path_util.cpp')
-rw-r--r--src/common/fs/path_util.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index dc1071b9ca..8f1fe1402e 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -294,17 +294,15 @@ std::string GetLegacyPathString(EmuPath legacy_path) {
}
void SetEdenPath(EdenPath eden_path, const fs::path& new_path) {
- if (!FS::IsDir(new_path)) {
- LOG_ERROR(Common_Filesystem, "Filesystem object at new_path={} is not a directory",
- PathToUTF8String(new_path));
- return;
+ auto& instance = PathManagerImpl::GetInstance();
+ if (FS::IsDir(new_path)) {
+ instance.SetEdenPathImpl(eden_path, new_path);
+ } else {
+ LOG_ERROR(Common_Filesystem, "Filesystem object at new_path={} is not a directory", PathToUTF8String(new_path));
}
-
- PathManagerImpl::GetInstance().SetEdenPathImpl(eden_path, new_path);
}
-void CreateEdenPaths()
-{
+void CreateEdenPaths() {
PathManagerImpl::GetInstance().CreateEdenPaths();
}