]> sigrok.org Git - pulseview.git/commitdiff
Added proper error handling to pv::SigSession::feed_in_header()
authorJoel Holdsworth <redacted>
Mon, 22 Apr 2013 20:42:26 +0000 (21:42 +0100)
committerJoel Holdsworth <redacted>
Mon, 22 Apr 2013 20:42:26 +0000 (21:42 +0100)
pv/sigsession.cpp

index 782f9c791b472ab24bb848958e847ded490d63d5..e22b75a642bfbe635d85f21bcf8275a7073413f8 100644 (file)
@@ -221,7 +221,11 @@ void SigSession::feed_in_header(const sr_dev_inst *sdi)
 
        const int ret = sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
                &gvar, sdi);
-       assert(ret == SR_OK);
+       if (ret != SR_OK) {
+               qDebug("Failed to get samplerate\n");
+               return;
+       }
+
        sample_rate = g_variant_get_uint64(gvar);
        g_variant_unref(gvar);