From 90037b772c525ad734acb4641c9dacb7abf48ffe Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 4 Apr 2013 22:03:03 +0200 Subject: [PATCH] libubus: fix crash on reconnect with objects that have no type Signed-off-by: John Crispin --- libubus-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libubus-io.c b/libubus-io.c index 0e7f25f..ca5fdaf 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -190,7 +190,8 @@ ubus_refresh_state(struct ubus_context *ctx) /* clear all type IDs, they need to be registered again */ avl_for_each_element(&ctx->objects, obj, avl) - obj->type->id = 0; + if (obj->type) + obj->type->id = 0; /* push out all objects again */ avl_for_each_element_safe(&ctx->objects, obj, avl, tmp) { -- 2.11.0