proto: if the target object no longer exists, don't send events/requests

This commit is contained in:
Peter Hutterer 2023-02-14 13:11:01 +10:00
parent 86dced2c40
commit df99fc923b

View file

@ -73,6 +73,9 @@ const struct brei_object *
int
{{outgoing.fqdn}}({{interface.as_arg}}{%- for arg in outgoing.arguments %}, {{arg.as_arg}}{% endfor %})
{
if (!{{interface.name}})
return -ENOENT;
const struct brei_object *obj = {{interface.name}}_get_proto_object({{interface.name}});
{{target.ctype}} ctx = {{interface.name}}_get_{{target.context}}({{interface.name}});