From: Joel Holdsworth Date: Mon, 22 Apr 2013 20:42:26 +0000 (+0100) Subject: Added proper error handling to pv::SigSession::feed_in_header() X-Git-Tag: pulseview-0.1.0~27 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=174e27a1f67683c608277ae522931579cad30eaf;p=pulseview.git Added proper error handling to pv::SigSession::feed_in_header() --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 782f9c79..e22b75a6 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -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);