1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 14:04:46 -04:00

Server: Web API: implemented /sdrangel/preset POST

This commit is contained in:
f4exb
2017-12-21 00:23:36 +01:00
parent 9dd707896d
commit 15453b7528
3 changed files with 64 additions and 3 deletions
+2 -2
View File
@@ -433,7 +433,7 @@ int WebAPIAdapterGUI::instancePresetPut(
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
if (deviceSetIndex > nbDeviceSets)
if (deviceSetIndex >= nbDeviceSets)
{
*error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
return 404;
@@ -489,7 +489,7 @@ int WebAPIAdapterGUI::instancePresetPost(
SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
if (deviceSetIndex > nbDeviceSets)
if (deviceSetIndex >= nbDeviceSets)
{
*error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
return 404;