]> sigrok.org Git - libsigrokflow.git/commitdiff
Throw exception on failure to create element.
authorMartin Ling <redacted>
Sun, 30 Dec 2018 00:25:39 +0000 (01:25 +0100)
committerUwe Hermann <redacted>
Tue, 8 Jan 2019 15:04:19 +0000 (16:04 +0100)
src/main.cpp

index 19d1f35eb733bd27d49e78f424fbaf3639cbb8ab..ead3446fc8cc9a49353131bfd97f5216f26e8206 100644 (file)
@@ -36,6 +36,8 @@ Glib::RefPtr<LegacyCaptureDevice>LegacyCaptureDevice::create(
        shared_ptr<sigrok::HardwareDevice> 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<LegacyCaptureDevice>::cast_static(element);
 
        auto src_template = Gst::PadTemplate::create("src",