aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/writer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index fcab66cf..15b527a2 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -896,7 +896,8 @@ serd_writer_end_anon(SerdWriter* writer,
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));
}