summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-03-25 00:33:10 +0000
committerDavid Robillard <d@drobilla.net>2013-03-25 00:33:10 +0000
commit3c45957cdb38a115d013dd5d96f60b6ee1320229 (patch)
tree775bb0f0d297803c92149ab4fc6e55eb20e148b4 /src
parent52c617694203c9dbc20189f5bae3b6446df87bd9 (diff)
downloadlilv-3c45957cdb38a115d013dd5d96f60b6ee1320229.tar.gz
lilv-3c45957cdb38a115d013dd5d96f60b6ee1320229.tar.bz2
lilv-3c45957cdb38a115d013dd5d96f60b6ee1320229.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/state.c4
1 files changed, 2 insertions, 2 deletions
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;