From 4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 1 May 2021 19:29:32 +0100 Subject: Error on bad cast of referenced object --- lib/persistence.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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(sharedObjects.at(id))) { this->v = std::move(teo); } + else { + throw std::runtime_error("Named type doesn't cast to target type"); + } } }; } -- cgit v1.2.3