aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/writer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c
index 57e5dc92..08e9ae17 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -677,7 +677,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
@@ -718,8 +718,7 @@ serd_writer_write_statement(SerdWriter* writer,
const SerdNode* const object = serd_statement_get_object(statement);
const SerdNode* const graph = serd_statement_get_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;
}