summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-11-03 14:17:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-11-05 20:07:04 +0000
commit7c3119ed413704a8e2fcbf1c988a14a4a61ce6c5 (patch)
treea107ace064b7c440285f1be1e03e0f6c7b7dea2e /lib
parentFix pruning of link history (diff)
downloadilt-main.tar.bz2
ilt-main.tar.xz
ilt-main.zip
Throw if input stream not in good state reading JSONHEADmain
Diffstat (limited to 'lib')
-rw-r--r--lib/jsonParse-persistence.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/jsonParse-persistence.h b/lib/jsonParse-persistence.h
index 6edebc7..e4e64c0 100644
--- a/lib/jsonParse-persistence.h
+++ b/lib/jsonParse-persistence.h
@@ -15,6 +15,9 @@ namespace Persistence {
inline T
loadState(std::istream & in)
{
+ if (!in.good()) {
+ throw std::runtime_error("Input stream not in good state");
+ }
T t {};
stk.push(std::make_unique<SelectionT<T>>(std::ref(t)));
loadState(in);