From e952c613c271dac7f4565de2ab151f7368985589 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 3 Jun 2016 21:28:36 +0300 Subject: Card::get_object(): return nullptr if not found --- libkms++/card.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libkms++') diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 30f3abf..23a6840 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -165,7 +165,10 @@ Connector* Card::get_first_connected_connector() const DrmObject* Card::get_object(uint32_t id) const { - return m_obmap.at(id); + auto iter = m_obmap.find(id); + if (iter != m_obmap.end()) + return iter->second; + return nullptr; } const vector Card::get_objects() const -- cgit v1.2.3