From 942a2cd4d60736fca53944517cf522ca37c31bc0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 29 Oct 2015 14:23:37 +0000 Subject: Fix restoring plugins with no state interface git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5802 a436a847-0d15-0410-975c-d299462d15a1 --- src/state.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/state.c b/src/state.c index dbbcdd0..15de044 100644 --- a/src/state.c +++ b/src/state.c @@ -436,13 +436,15 @@ lilv_state_restore(const LilvState* state, const LV2_State_Interface* iface = (const LV2_State_Interface*) desc->extension_data(LV2_STATE__interface); - const LV2_Feature** sfeatures = add_features( - features, &map_feature, NULL); + if (iface && iface->restore) { + const LV2_Feature** sfeatures = add_features( + features, &map_feature, NULL); - iface->restore(instance->lv2_handle, retrieve_callback, - (LV2_State_Handle)state, flags, sfeatures); + iface->restore(instance->lv2_handle, retrieve_callback, + (LV2_State_Handle)state, flags, sfeatures); - free(sfeatures); + free(sfeatures); + } } } -- cgit v1.2.1