aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-10 18:01:04 +0100
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit234f443965b454118e5413264780706bcaa63ea3 (patch)
tree18272a27fe4a6237b60c9859f31fc802f65d4d43
parent96a25084fbc1c749019f5e2b21b657dd3cf09c88 (diff)
downloadserd-234f443965b454118e5413264780706bcaa63ea3.tar.gz
serd-234f443965b454118e5413264780706bcaa63ea3.tar.bz2
serd-234f443965b454118e5413264780706bcaa63ea3.zip
Tolerate lack of predicate when context is popped
-rw-r--r--src/writer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index 502d74d3..1e453ddd 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -1029,7 +1029,8 @@ serd_writer_end_anon(SerdWriter* writer, const SerdNode* node)
write_sep(writer, writer->context.flags, SEP_ANON_END);
pop_context(writer);
- if (serd_node_equals(node, writer->context.subject)) {
+ if (writer->context.predicate &&
+ serd_node_equals(node, writer->context.subject)) {
// Now-finished anonymous node is the new subject with no other context
memset(writer->context.predicate, 0, sizeof(SerdNode));
}