diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-05-01 19:29:32 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-07 16:41:37 +0000 |
commit | 4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c (patch) | |
tree | f10b6a00dfbcd061da160a63007fbe7c593f6501 /lib/persistence.h | |
parent | Name, rather than number, shared_ptr tests (diff) | |
download | ilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.tar.bz2 ilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.tar.xz ilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.zip |
Error on bad cast of referenced object
Diffstat (limited to 'lib/persistence.h')
-rw-r--r-- | lib/persistence.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/persistence.h b/lib/persistence.h index 86b0dce..e8e3415 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -303,6 +303,9 @@ namespace Persistence { if (auto teo = std::dynamic_pointer_cast<T>(sharedObjects.at(id))) { this->v = std::move(teo); } + else { + throw std::runtime_error("Named type doesn't cast to target type"); + } } }; } |