diff options
author | David Robillard <d@drobilla.net> | 2014-10-05 03:28:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-10-05 03:28:40 +0000 |
commit | ef429b7f1abaca3ece35ffe4b5f337450aa1a829 (patch) | |
tree | 05eb399260e24d484004c147fcc69166bcc40eab /src | |
parent | 4e3571f8fd583ea808cb1f56a197ab95aabe9be7 (diff) | |
download | lilv-ef429b7f1abaca3ece35ffe4b5f337450aa1a829.tar.gz lilv-ef429b7f1abaca3ece35ffe4b5f337450aa1a829.tar.bz2 lilv-ef429b7f1abaca3ece35ffe4b5f337450aa1a829.zip |
Tolerate passing NULL to lilv_state_restore().
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5473 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/state.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/state.c b/src/state.c index 68d48f1..7968493 100644 --- a/src/state.c +++ b/src/state.c @@ -403,6 +403,11 @@ lilv_state_restore(const LilvState* state, uint32_t flags, const LV2_Feature *const * features) { + if (!state) { + LILV_ERROR("lilv_state_restore() called on NULL state\n"); + return; + } + LV2_State_Map_Path map_path = { (LilvState*)state, abstract_path, absolute_path }; LV2_Feature map_feature = { LV2_STATE__mapPath, &map_path }; @@ -581,10 +586,7 @@ lilv_state_new_from_world(LilvWorld* world, return NULL; } - LilvState* state = new_state_from_model( - world, map, world->model, node->node, NULL); - - return state; + return new_state_from_model(world, map, world->model, node->node, NULL); } LILV_API LilvState* |