mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-08-11 18:22:25 -04:00
SDRplay: Prevent nullpointer dereference for #1825
This commit is contained in:
parent
480241fa8e
commit
9098f26679
@ -320,9 +320,11 @@ void SDRPlayV3Gui::updateLNAValues()
|
||||
bool found = false;
|
||||
|
||||
const int *attenuations = SDRPlayV3LNA::getAttenuations(m_sdrPlayV3Input->getDeviceId(), m_settings.m_centerFrequency);
|
||||
int len = attenuations[0];
|
||||
ui->gainLNA->blockSignals(true);
|
||||
ui->gainLNA->clear();
|
||||
if (attenuations)
|
||||
{
|
||||
int len = attenuations[0];
|
||||
for (int i = 1; i <= len; i++)
|
||||
{
|
||||
if (attenuations[i] == 0)
|
||||
@ -337,6 +339,11 @@ void SDRPlayV3Gui::updateLNAValues()
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "SDRPlayV3Gui::updateLNAValues: No attenuations for deviceID: " << m_sdrPlayV3Input->getDeviceId();
|
||||
}
|
||||
ui->gainLNA->blockSignals(false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user