From 14b92bea172df18eb3f577e99a877fd6288379eb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Wed, 8 Feb 2023 19:05:18 +0100 Subject: Fix crash on firing timer when object is gone already --- connectionregistry.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'connectionregistry.cpp') diff --git a/connectionregistry.cpp b/connectionregistry.cpp index 412472d..5b2ea2b 100644 --- a/connectionregistry.cpp +++ b/connectionregistry.cpp @@ -53,11 +53,17 @@ void ConnectionRegistry::delConnection(ConnectionRegistry::connection c) std::unordered_set::iterator ConnectionRegistry::begin(const std::string& id) { + if (!m_ids.contains(id)) + return std::unordered_set::iterator{}; + return m_ids.at(id).begin(); } std::unordered_set::iterator ConnectionRegistry::end(const std::string& id) { + if (!m_ids.contains(id)) + return std::unordered_set::iterator{}; + return m_ids.at(id).end(); } -- cgit v1.2.3