summaryrefslogtreecommitdiff
path: root/kms++/src
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-12-03 11:10:52 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-12-03 11:10:52 +0200
commit79b60742131540b4c30db9aa4342c513dee389a7 (patch)
tree4c5567667a6e54e02a1a153a2180394bcd1f469b /kms++/src
parent6fa8696774c4bda4bb7e3efabd7e1e58a899f5c1 (diff)
atomicreq: throw on non-existing property
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/src')
-rw-r--r--kms++/src/atomicreq.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kms++/src/atomicreq.cpp b/kms++/src/atomicreq.cpp
index e01d7c2..1ef4f7d 100644
--- a/kms++/src/atomicreq.cpp
+++ b/kms++/src/atomicreq.cpp
@@ -62,7 +62,12 @@ void AtomicReq::add(DrmPropObject* ob, Property* prop, uint64_t value)
void AtomicReq::add(kms::DrmPropObject* ob, const string& prop, uint64_t value)
{
- add(ob, ob->get_prop(prop), value);
+ Property* p = ob->get_prop(prop);
+
+ if (!p)
+ throw runtime_error("Property not found");
+
+ add(ob, p, value);
}
void AtomicReq::add(kms::DrmPropObject* ob, const map<string, uint64_t>& values)