diff options
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 43c6ae54ab..2ed9cf7048 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1047,8 +1047,10 @@ void DirectoryCommit(const fs::path &dirname) { #ifndef WIN32 FILE* file = fsbridge::fopen(dirname, "r"); - fsync(fileno(file)); - fclose(file); + if (file) { + fsync(fileno(file)); + fclose(file); + } #endif } |