diff options
author | David Robillard <d@drobilla.net> | 2008-12-13 05:47:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-12-13 05:47:50 +0000 |
commit | 90885da36afd20388a6eeeb58efcd844398bc531 (patch) | |
tree | a5cce42b5bae93d1c910a8a12af3d927bd8d114e /src/plugin.c | |
parent | baa2354cf47b093117206fd1fc1bae45e46b03c3 (diff) | |
download | lilv-90885da36afd20388a6eeeb58efcd844398bc531.tar.gz lilv-90885da36afd20388a6eeeb58efcd844398bc531.tar.bz2 lilv-90885da36afd20388a6eeeb58efcd844398bc531.zip |
Handle librdf failures (NULL values) and crazily typed values etc. more gracefully.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1860 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r-- | src/plugin.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugin.c b/src/plugin.c index 6ac5094..3b42f51 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -151,6 +151,11 @@ slv2_plugin_load(SLV2Plugin p) librdf_node* class_node = librdf_query_results_get_binding_value(results, 0); librdf_uri* class_uri = librdf_node_get_uri(class_node); + if (!class_uri) { + librdf_query_results_next(results); + continue; + } + SLV2Value class = slv2_value_new_librdf_uri(p->world, class_uri); if ( ! slv2_value_equals(class, p->world->lv2_plugin_class->uri)) { @@ -265,9 +270,11 @@ slv2_plugin_load(SLV2Plugin p) if (!librdf_query_results_finished(results)) { librdf_node* binary_node = librdf_query_results_get_binding_value(results, 0); librdf_uri* binary_uri = librdf_node_get_uri(binary_node); - - SLV2Value binary = slv2_value_new_librdf_uri(p->world, binary_uri); - p->binary_uri = binary; + + if (binary_uri) { + SLV2Value binary = slv2_value_new_librdf_uri(p->world, binary_uri); + p->binary_uri = binary; + } librdf_free_node(binary_node); } |