Fix PHP notice when saving a sensor without any settings.
This commit is contained in:
parent
2ba9906168
commit
9adba48106
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue