From 79b60742131540b4c30db9aa4342c513dee389a7 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 3 Dec 2020 11:10:52 +0200 Subject: atomicreq: throw on non-existing property Signed-off-by: Tomi Valkeinen --- kms++/src/atomicreq.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'kms++') 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& values) -- cgit v1.2.3