summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-12-04 21:24:05 -0500
committerDavid Robillard <d@drobilla.net>2015-12-04 21:24:05 -0500
commit19cd4c95e10ec83f8fbf41809e9d3688c64bd2d8 (patch)
treea13f722fbf4111e61dd6618ad40cc9e2e085ef6c
parentf391b49c87f152fbfee73890de1a9985fe9b81c2 (diff)
downloadsord-19cd4c95e10ec83f8fbf41809e9d3688c64bd2d8.tar.gz
sord-19cd4c95e10ec83f8fbf41809e9d3688c64bd2d8.tar.bz2
sord-19cd4c95e10ec83f8fbf41809e9d3688c64bd2d8.zip
Return inserter error when node can not be written
-rw-r--r--NEWS4
-rw-r--r--src/syntax.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 988debd..6d8e96d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,10 @@
sord (0.14.1) unstable;
* Fix documentation generation
+ * Return error from sord_inserter_write_statement() if a node can not be written
+ (e.g. undefined prefix)
- -- David Robillard <d@drobilla.net> Thu, 08 Oct 2015 17:48:51 -0400
+ -- David Robillard <d@drobilla.net> Fri, 04 Dec 2015 21:23:36 -0500
sord (0.14.0) stable;
diff --git a/src/syntax.c b/src/syntax.c
index f17312f..ee9fec1 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -78,6 +78,10 @@ sord_inserter_write_statement(SordInserter* inserter,
SordNode* o = sord_node_from_serd_node(world, env, object,
object_datatype, object_lang);
+ if (!s || !p || !o) {
+ return SERD_ERR_BAD_ARG;
+ }
+
const SordQuad tup = { s, p, o, g };
sord_add(inserter->model, tup);