apply-default-node: Make sure the metadata is valid

This fixes some warnings in the Lua tests scripts from tests/scripts/scripts/*
This commit is contained in:
Julian Bouzas 2025-10-28 09:38:16 -04:00 committed by George Kiagiadakis
parent 238fd3c067
commit c0e047c241

View file

@ -24,6 +24,9 @@ SimpleEventHook {
local om = source:call ("get-object-manager", "metadata") local om = source:call ("get-object-manager", "metadata")
local metadata = om:lookup { Constraint { "metadata.name", "=", "default" } } local metadata = om:lookup { Constraint { "metadata.name", "=", "default" } }
if metadata == nil then
return
end
if selected_node then if selected_node then
local key = "default." .. def_node_type local key = "default." .. def_node_type