Reverse the logic to make it clearer what is happening

This commit is contained in:
Paul Gear
2015-06-08 21:50:50 +10:00
parent 1ddaa5c288
commit e77d4d3063

View File

@ -201,11 +201,11 @@ function poll_device($device, $options)
foreach (dbFetch("SELECT `graph` FROM `device_graphs` WHERE `device_id` = ?", array($device['device_id'])) as $graph)
{
if (!isset($graphs[$graph["graph"]]))
if (isset($graphs[$graph["graph"]]))
{
dbDelete('device_graphs', "`device_id` = ? AND `graph` = ?", array($device['device_id'], $graph["graph"]));
} else {
$oldgraphs[$graph["graph"]] = TRUE;
} else {
dbDelete('device_graphs', "`device_id` = ? AND `graph` = ?", array($device['device_id'], $graph["graph"]));
}
}