Fix PHP notice when saving a sensor without any settings.

This commit is contained in:
Michael Stenta 2016-01-01 19:30:33 -05:00
parent 2ba9906168
commit 9adba48106
1 changed files with 5 additions and 0 deletions

View File

@ -181,6 +181,11 @@ function _farm_sensor_entity_save($entity, $type) {
return;
}
// If sensor settings are not set, save an empty array.
if (!isset($entity->sensor_settings)) {
$entity->sensor_settings = array();
}
// Save the sensor record.
farm_sensor_save($entity->id, $entity->sensor_type, $entity->sensor_settings);
}