Card::get_object(): return nullptr if not found
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 3 Jun 2016 18:28:36 +0000 (21:28 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Sat, 4 Jun 2016 19:33:54 +0000 (22:33 +0300)
libkms++/card.cpp

index 30f3abff0d41c8cf1c71e950afb39fea70a6729b..23a6840b30a40cf32724adf3d2d39a51882ac0d0 100644 (file)
@@ -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<DrmObject*> Card::get_objects() const