From 69f528709d4e972ee46f701d324b7e536b454191 Mon Sep 17 00:00:00 2001 From: "Christian W. Zuckschwerdt" Date: Mon, 18 Mar 2019 17:34:23 +0100 Subject: [PATCH] Only set info name if available --- PlutoSDR_Settings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PlutoSDR_Settings.cpp b/PlutoSDR_Settings.cpp index 40afba9..13dcc6d 100644 --- a/PlutoSDR_Settings.cpp +++ b/PlutoSDR_Settings.cpp @@ -245,8 +245,9 @@ SoapySDR::ArgInfo SoapyPlutoSDR::getSensorInfo(const std::string &key) const iio_channel *chn = iio_device_find_channel(dev, channelStr.c_str(), false); //if (!chn) ... + const char *name = iio_channel_get_name(chn); info.key = key; - info.name = iio_channel_get_name(chn); + if (name) info.name = name; info.type = SoapySDR::ArgInfo::FLOAT; info.value = "0.0"; info.units = id_to_unit(channelStr.c_str());