summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-10-12 23:15:51 +0000
committerDavid Robillard <d@drobilla.net>2008-10-12 23:15:51 +0000
commit36d1f6988cdb89b072408b13d0f2178d6fa72c1d (patch)
tree20a1f6a990560a2e53c8e7485b8d15d44686a5c4 /src/plugin.c
parentb2221e204e3342d40308c55f4f35180175c1157f (diff)
downloadlilv-36d1f6988cdb89b072408b13d0f2178d6fa72c1d.tar.gz
lilv-36d1f6988cdb89b072408b13d0f2178d6fa72c1d.tar.bz2
lilv-36d1f6988cdb89b072408b13d0f2178d6fa72c1d.zip
Tolerate broken plugins.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1667 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 25ddd5c..a96a93c 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -543,13 +543,14 @@ slv2_plugin_get_port_float_values(SLV2Plugin p,
while (!librdf_query_results_finished(results)) {
librdf_node* idx_node = librdf_query_results_get_binding_value(results, 0);
librdf_node* val_node = librdf_query_results_get_binding_value(results, 1);
- assert(librdf_node_is_literal(idx_node));
- assert(librdf_node_is_literal(val_node));
- const int idx = atoi((const char*)librdf_node_get_literal_value(idx_node));
- const float val = atof((const char*)librdf_node_get_literal_value(val_node));
- values[idx] = val;
- librdf_free_node(idx_node);
- librdf_free_node(val_node);
+ if (idx_node && val_node && librdf_node_is_literal(idx_node)
+ && librdf_node_is_literal(val_node)) {
+ const int idx = atoi((const char*)librdf_node_get_literal_value(idx_node));
+ const float val = atof((const char*)librdf_node_get_literal_value(val_node));
+ values[idx] = val;
+ librdf_free_node(idx_node);
+ librdf_free_node(val_node);
+ }
librdf_query_results_next(results);
}