mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: do not create config section in/out if not existant
This commit is contained in:
parent
c8ba97d94e
commit
98a4e52b47
1 changed files with 3 additions and 6 deletions
|
@ -241,12 +241,9 @@ int node_parse(struct node *n, json_t *json, const char *name)
|
|||
for (int j = 0; j < ARRAY_LEN(dirs); j++) {
|
||||
json_t *json_dir = json_object_get(json, dirs [j].str);
|
||||
|
||||
// Create empty object if not existing
|
||||
if (!json_dir) {
|
||||
json_dir = json_object();
|
||||
|
||||
json_object_set(json, dirs[j].str, json_dir);
|
||||
}
|
||||
// Skip if direction is unused
|
||||
if (!json_dir)
|
||||
json_dir = json_pack("{ s: b }", "enabled", 0);
|
||||
|
||||
// Copy missing fields from main node config to direction config
|
||||
for (int i = 0; i < ARRAY_LEN(fields); i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue