summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-04-29 23:29:10 +0000
committerDavid Robillard <d@drobilla.net>2008-04-29 23:29:10 +0000
commit7710f68e240a2454ba68cf23872065ca9ec500fe (patch)
treeba7606849b3d810f27b82a92992897dc70296aff /src
parent014d957c0da362f4036af90d3328adb3aa7f15a9 (diff)
downloadlilv-7710f68e240a2454ba68cf23872065ca9ec500fe.tar.gz
lilv-7710f68e240a2454ba68cf23872065ca9ec500fe.tar.bz2
lilv-7710f68e240a2454ba68cf23872065ca9ec500fe.zip
Fix librdf assertion failures on plugins where no binary is found.
git-svn-id: http://svn.drobilla.net/lad/slv2@1182 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/plugin.c2
-rw-r--r--src/world.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 360fbeb..4cdc1ed 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -41,7 +41,7 @@ slv2_plugin_new(SLV2World world, SLV2Value uri, librdf_uri* bundle_uri, librdf_u
plugin->world = world;
plugin->plugin_uri = uri;
plugin->bundle_uri = slv2_value_new_librdf_uri(world, bundle_uri);
- plugin->binary_uri = slv2_value_new_librdf_uri(world, binary_uri);
+ plugin->binary_uri = binary_uri ? slv2_value_new_librdf_uri(world, binary_uri) : NULL;
plugin->plugin_class = NULL;
plugin->data_uris = slv2_values_new();
plugin->ports = raptor_new_sequence((void (*)(void*))&slv2_port_free, NULL);
diff --git a/src/world.c b/src/world.c
index 9356579..bebf540 100644
--- a/src/world.c
+++ b/src/world.c
@@ -528,7 +528,7 @@ slv2_world_load_all(SLV2World world)
librdf_node* bundle_node = librdf_query_results_get_binding_value(results, 2);
librdf_uri* bundle_uri = librdf_node_get_uri(bundle_node);
librdf_node* binary_node = librdf_query_results_get_binding_value(results, 3);
- librdf_uri* binary_uri = librdf_node_get_uri(binary_node);
+ librdf_uri* binary_uri = binary_node ? librdf_node_get_uri(binary_node) : NULL;
assert(plugin_uri);
assert(data_uri);
@@ -558,7 +558,8 @@ slv2_world_load_all(SLV2World world)
librdf_free_node(plugin_node);
librdf_free_node(data_node);
librdf_free_node(bundle_node);
- librdf_free_node(binary_node);
+ if (binary_node)
+ librdf_free_node(binary_node);
librdf_query_results_next(results);
}