Skip to content

Commit

Permalink
Merge pull request #4855 from manup/master
Browse files Browse the repository at this point in the history
Fix static analyzer warning in checkSensorButtonEvent()
  • Loading branch information
manup authored May 9, 2021
2 parents 066192b + 7304060 commit 98a69aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand Down

0 comments on commit 98a69aa

Please sign in to comment.