summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);