summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/instance.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index d8db3d2..fa3f424 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,11 @@
lilv (0.24.3) unstable;
+ * Gracefully handle plugins with missing binary URIs
* Remove use of deprecated readdir_r
* Install Python bindings when configured without tests
(thanks Clement Skau)
- -- David Robillard <d@drobilla.net> Mon, 20 Feb 2017 19:38:44 +0100
+ -- David Robillard <d@drobilla.net> Mon, 06 Mar 2017 18:57:09 +0100
lilv (0.24.2) stable;
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);