diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-02-08 19:05:18 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-02-08 19:05:18 +0100 |
commit | 14b92bea172df18eb3f577e99a877fd6288379eb (patch) | |
tree | b55b94e317881ca592ea3292039b00310225c504 /connectionregistry.cpp | |
parent | 2ddb1ffe419af7189fa406978411db7d03eb8f35 (diff) |
Fix crash on firing timer when object is gone already
Diffstat (limited to 'connectionregistry.cpp')
-rw-r--r-- | connectionregistry.cpp | 6 |
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(); } |