summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/state.c12
1 files 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);
+ }
}
}