From: Martin Ling Date: Sun, 30 Dec 2018 00:25:39 +0000 (+0100) Subject: Throw exception on failure to create element. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d75c9a6aab73eec3921cb951c3253afc4269ccb3;p=libsigrokflow.git Throw exception on failure to create element. --- diff --git a/src/main.cpp b/src/main.cpp index 19d1f35..ead3446 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,6 +36,8 @@ Glib::RefPtrLegacyCaptureDevice::create( shared_ptr libsigrok_device) { auto element = Gst::ElementFactory::create_element("sigrok_legacy_capture_device"); + if (!element) + throw runtime_error("Failed to create element - plugin not registered?"); auto device = Glib::RefPtr::cast_static(element); auto src_template = Gst::PadTemplate::create("src",