summaryrefslogtreecommitdiffstats
path: root/src/instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/instance.c')
-rw-r--r--src/instance.c12
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);