Skip to content

Commit 8d73e34

Browse files
committed
Fix incorrectly trying to set value when model column is undefined
1 parent 1290c8f commit 8d73e34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

LibreNMS/Discovery/YamlDiscoveryDefinition.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ public function discover($yaml, $attributes = []): Collection
150150
/** @var YamlDiscoveryField $field */
151151
foreach ($this->fields as $field) {
152152
// fill attributes
153-
$field->calculateValue($yamlItem, $fetchedData, $index, $count);
154-
$modelAttributes[$field->model_column] = $field->value;
153+
if ($field->model_column !== null) {
154+
$field->calculateValue($yamlItem, $fetchedData, $index, $count);
155+
$modelAttributes[$field->model_column] = $field->value;
156+
}
155157
}
156158

157159
// if no pollable oid found, skip this index

0 commit comments

Comments
 (0)