From df99fc923be767069aaced4115a079c36966daa6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 14 Feb 2023 13:11:01 +1000 Subject: [PATCH] proto: if the target object no longer exists, don't send events/requests --- proto/ei-proto.c.tmpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proto/ei-proto.c.tmpl b/proto/ei-proto.c.tmpl index aab4735..4ede48a 100644 --- a/proto/ei-proto.c.tmpl +++ b/proto/ei-proto.c.tmpl @@ -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}});