diff options
-rw-r--r-- | src/plugin.c | 2 | ||||
-rw-r--r-- | src/world.c | 5 |
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); } |