aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/writer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c
index 99a9beac..df513342 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -702,7 +702,7 @@ write_node(SerdWriter* writer,
static inline bool
is_resource(const SerdNode* node)
{
- return node->type > SERD_LITERAL;
+ return node && node->type > SERD_LITERAL;
}
static void
@@ -746,8 +746,7 @@ serd_writer_write_statement(SerdWriter* writer,
const SerdNode* const object = serd_statement_object(statement);
const SerdNode* const graph = serd_statement_graph(statement);
- if (!subject || !predicate || !object ||
- !is_resource(subject) || !is_resource(predicate)) {
+ if (!is_resource(subject) || !is_resource(predicate) || !object) {
return SERD_ERR_BAD_ARG;
}