Reorder error handling in extdata FS::CreateFile (#7346)

* Reorder error handling in extdata CreateFile

* Apply suggestions
This commit is contained in:
PabloMK7
2024-01-13 21:37:06 +01:00
committed by GitHub
parent 30c53c9509
commit 72c1075402
3 changed files with 12 additions and 12 deletions

View File

@ -232,8 +232,13 @@ Result SaveDataArchive::CreateFile(const FileSys::Path& path, u64 size) const {
}
if (size == 0) {
FileUtil::CreateEmptyFile(full_path);
return ResultSuccess;
if (allow_zero_size_create) {
FileUtil::CreateEmptyFile(full_path);
return ResultSuccess;
} else {
LOG_DEBUG(Service_FS, "Zero-size file is not supported");
return ResultUnsupportedOpenFlags;
}
}
FileUtil::IOFile file(full_path, "wb");