diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-03 21:28:36 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-04 22:33:54 +0300 |
commit | e952c613c271dac7f4565de2ab151f7368985589 (patch) | |
tree | 45547167957078098b8ef960f6b8dd028e33e1d0 | |
parent | 9c60065905e9e04ff9c897504fdfb82af14f2e63 (diff) |
Card::get_object(): return nullptr if not found
-rw-r--r-- | libkms++/card.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<DrmObject*> Card::get_objects() const |