mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:33:23 +00:00
Don't try to dereference empty product/vendor list
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
8467e53f11
commit
d17bb6318e
1 changed files with 4 additions and 0 deletions
|
@ -378,6 +378,8 @@ QString DCDeviceData::getDeviceDescriptorVendor(const QString ¤tVendorText
|
|||
// unsure being a dive computer
|
||||
if (currentVendorText == QObject::tr("Paired Bluetooth Devices")) {
|
||||
int i = productList[currentVendorText].indexOf(currentProductText);
|
||||
if (i < 0 || btAllDevices.length() <= i)
|
||||
return QString();
|
||||
QString dcVendor = dc_descriptor_get_vendor(btAllDevices[i].dcDescriptor);
|
||||
qDebug() << "getDeviceDescriptorVendor" << dcVendor;
|
||||
return dcVendor;
|
||||
|
@ -406,6 +408,8 @@ QString DCDeviceData::getDeviceDescriptorProduct(const QString ¤tVendorTex
|
|||
// unsure being a dive computer
|
||||
if (currentVendorText == QObject::tr("Paired Bluetooth Devices")) {
|
||||
int i = productList[currentVendorText].indexOf(currentProductText);
|
||||
if (i >= btAllDevices.length() || i < 0)
|
||||
return QString();
|
||||
QString dcProduct = dc_descriptor_get_product(btAllDevices[i].dcDescriptor);
|
||||
qDebug() << "getDeviceDescriptorProduct" << dcProduct;
|
||||
return dcProduct;
|
||||
|
|
Loading…
Add table
Reference in a new issue