Fix static analyzer warning in checkSensorButtonEvent()
In theory item pointer should never be null, the explicit check prevents false positive warnings for clang scan-build.
@@ -4252,7 +4252,6 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
if (ind.dstAddressMode() == deCONZ::ApsGroupAddress && ind.dstAddress().group() != 0)
{
- QStringList gids;
ResourceItem *item = sensor->addItem(DataTypeString, RConfigGroup);
quint16 groupId = ind.dstAddress().group();
@@ -4272,18 +4271,19 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
}
}
- QString gid = QString::number(groupId);
+ QStringList gids;
+ const QString gid = QString::number(groupId);
if (item)
{
gids = item->toString().split(',');
}
- if (sensor->manufacturer() == QLatin1String("ubisys"))
+ if (!item) // should always be non null, this check is here to keep static analizer happy
{
- // TODO
+
}
- if (sensor->modelId().startsWith(QLatin1String("RC 110"))) // innr remote
+ else if (sensor->modelId().startsWith(QLatin1String("RC 110"))) // innr remote
{
// 7 controller endpoints: 0x01, 0x03, 0x04, ..., 0x08
if (gids.length() != 7)
