Card::get_object(): return nullptr if not found
[android/external-libkmsxx.git] / 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