summaryrefslogtreecommitdiffhomepage
path: root/connectionregistry.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-02-08 19:05:18 +0100
committerRoland Reichwein <mail@reichwein.it>2023-02-08 19:05:18 +0100
commit14b92bea172df18eb3f577e99a877fd6288379eb (patch)
treeb55b94e317881ca592ea3292039b00310225c504 /connectionregistry.cpp
parent2ddb1ffe419af7189fa406978411db7d03eb8f35 (diff)
Fix crash on firing timer when object is gone already
Diffstat (limited to 'connectionregistry.cpp')
-rw-r--r--connectionregistry.cpp6
1 files changed, 6 insertions, 0 deletions
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<ConnectionRegistry::connection>::iterator ConnectionRegistry::begin(const std::string& id)
{
+ if (!m_ids.contains(id))
+ return std::unordered_set<ConnectionRegistry::connection>::iterator{};
+
return m_ids.at(id).begin();
}
std::unordered_set<ConnectionRegistry::connection>::iterator ConnectionRegistry::end(const std::string& id)
{
+ if (!m_ids.contains(id))
+ return std::unordered_set<ConnectionRegistry::connection>::iterator{};
+
return m_ids.at(id).end();
}