From a59d888c9ee376017bafda747d04007705a8d09f Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Tue, 4 Jun 2013 11:12:32 +0100 Subject: [PATCH] idnode: allow property list to be written without an object This allows the "class" to be written out without the need for an instanatiation. Useful for auto-generating grid layouts for a given object type. --- src/prop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prop.c b/src/prop.c index 3f69c86c..18d235d3 100644 --- a/src/prop.c +++ b/src/prop.c @@ -162,7 +162,8 @@ prop_add_params_to_msg(void *obj, const property_t *p, htsmsg_t *msg) htsmsg_add_str(m, "type", val2str(p[i].type, typetab) ?: "unknown"); if (p->rdonly) htsmsg_add_u32(m, "rdonly", 1); - prop_read_value(obj, p+i, m, "value"); + if (obj) + prop_read_value(obj, p+i, m, "value"); htsmsg_add_msg(msg, NULL, m); } }