diff options
author | David Robillard <d@drobilla.net> | 2017-03-06 18:58:05 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-03-06 18:58:05 +0100 |
commit | 112061493cae8a669df359fa929dfd3ff87d7d0e (patch) | |
tree | 77935cee1972fac345533fa9880c94b2f2ed89f5 /src | |
parent | d8392945aacbf4ee854f0b36877a7d5e6b1aefcb (diff) | |
download | lilv-112061493cae8a669df359fa929dfd3ff87d7d0e.tar.gz lilv-112061493cae8a669df359fa929dfd3ff87d7d0e.tar.bz2 lilv-112061493cae8a669df359fa929dfd3ff87d7d0e.zip |
Gracefully handle plugins with missing binary URIs
Diffstat (limited to 'src')
-rw-r--r-- | src/instance.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/instance.c b/src/instance.c index d05defd..93f0754 100644 --- a/src/instance.c +++ b/src/instance.c @@ -30,10 +30,14 @@ lilv_plugin_instantiate(const LilvPlugin* plugin, return NULL; } - LilvInstance* result = NULL; - const LilvNode* const lib_uri = lilv_plugin_get_library_uri(plugin); - const LilvNode* const bundle_uri = lilv_plugin_get_bundle_uri(plugin); - char* const bundle_path = lilv_file_uri_parse( + LilvInstance* result = NULL; + const LilvNode* const lib_uri = lilv_plugin_get_library_uri(plugin); + const LilvNode* const bundle_uri = lilv_plugin_get_bundle_uri(plugin); + if (!lib_uri || !bundle_uri) { + return NULL; + } + + char* const bundle_path = lilv_file_uri_parse( lilv_node_as_uri(bundle_uri), NULL); LilvLib* lib = lilv_lib_open(plugin->world, lib_uri, bundle_path, features); |