From 6bc3a38aa2753e495cab15139aba47eb7df6bd91 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Wed, 9 Jun 2021 16:20:21 -0700 Subject: [PATCH] :bug: load/save error caught --- include/bank.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/bank.hpp b/include/bank.hpp index 0178a93..f1a2f10 100644 --- a/include/bank.hpp +++ b/include/bank.hpp @@ -286,6 +286,9 @@ public: if (!temp.isNull()) { writer->write(temp, &user_save); + } + else + { throw std::invalid_argument("Saving Failed\n"); } user_save.close(); @@ -303,8 +306,8 @@ public: if (!parseFromStream(builder, user_save, &temp, &errs)) { std::cerr << errs << '\n'; - throw std::invalid_argument("Parsing Failed\n"); user_save.close(); + throw std::invalid_argument("Parsing Failed\n"); } else {