summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);
}