From 3c45957cdb38a115d013dd5d96f60b6ee1320229 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 25 Mar 2013 00:33:10 +0000 Subject: Allow lilv_state_restore() to be used without passing an instance, for restoring port values via a callback only. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5100 a436a847-0d15-0410-975c-d299462d15a1 --- src/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 9ab441f..b2953a4 100644 --- a/src/state.c +++ b/src/state.c @@ -411,8 +411,8 @@ lilv_state_restore(const LilvState* state, const LV2_Feature** sfeatures = add_features(features, &map_feature, NULL); - const LV2_Descriptor* desc = instance->lv2_descriptor; - const LV2_State_Interface* iface = (desc->extension_data) + const LV2_Descriptor* desc = instance ? instance->lv2_descriptor : NULL; + const LV2_State_Interface* iface = (desc && desc->extension_data) ? (LV2_State_Interface*)desc->extension_data(LV2_STATE__interface) : NULL; -- cgit v1.2.1