diff options
| author | 2019-07-05 17:02:29 -0400 | |
|---|---|---|
| committer | 2019-07-05 17:02:32 -0400 | |
| commit | 7ad11e3867f4a7602edb8793c4c90d557d85c7c7 (patch) | |
| tree | 13b1789cc4e3277e2f815d89299c8d7620a1844f /src | |
| parent | Merge pull request #2601 from FernandoS27/texture_cache (diff) | |
| download | yuzu-7ad11e3867f4a7602edb8793c4c90d557d85c7c7.tar.gz yuzu-7ad11e3867f4a7602edb8793c4c90d557d85c7c7.tar.xz yuzu-7ad11e3867f4a7602edb8793c4c90d557d85c7c7.zip | |
core/reporter: Return in error case in SaveToFile()
If the path couldn't be created, then we shouldn't be attempting to save
the file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/reporter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 774022569..79af28314 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp | |||
| @@ -31,8 +31,10 @@ std::string GetTimestamp() { | |||
| 31 | using namespace nlohmann; | 31 | using namespace nlohmann; |
| 32 | 32 | ||
| 33 | void SaveToFile(const json& json, const std::string& filename) { | 33 | void SaveToFile(const json& json, const std::string& filename) { |
| 34 | if (!FileUtil::CreateFullPath(filename)) | 34 | if (!FileUtil::CreateFullPath(filename)) { |
| 35 | LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename); | 35 | LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename); |
| 36 | return; | ||
| 37 | } | ||
| 36 | 38 | ||
| 37 | std::ofstream file( | 39 | std::ofstream file( |
| 38 | FileUtil::SanitizePath(filename, FileUtil::DirectorySeparator::PlatformDefault)); | 40 | FileUtil::SanitizePath(filename, FileUtil::DirectorySeparator::PlatformDefault)); |