aboutsummaryrefslogtreecommitdiff
path: root/src/core/reporter.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-07-05 17:02:29 -0400
committerLioncash <mathew1800@gmail.com>2019-07-05 17:02:32 -0400
commit5db1fdfa4abfb55f1177b4cd793a5b3f89617062 (patch)
tree13b1789cc4e3277e2f815d89299c8d7620a1844f /src/core/reporter.cpp
parent3f7c8053c6764aa5ce88fd3d9b9aad48be8f9a15 (diff)
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/core/reporter.cpp')
-rw-r--r--src/core/reporter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp
index 7740225696..79af283143 100644
--- a/src/core/reporter.cpp
+++ b/src/core/reporter.cpp
@@ -31,8 +31,10 @@ std::string GetTimestamp() {
using namespace nlohmann;
void SaveToFile(const json& json, const std::string& filename) {
- if (!FileUtil::CreateFullPath(filename))
+ if (!FileUtil::CreateFullPath(filename)) {
LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename);
+ return;
+ }
std::ofstream file(
FileUtil::SanitizePath(filename, FileUtil::DirectorySeparator::PlatformDefault));