aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/node.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 4191dfe4..1644b6fc 100644
--- a/src/node.c
+++ b/src/node.c
@@ -26,6 +26,10 @@ SERD_API
SerdNode
serd_node_from_string(SerdType type, const uint8_t* buf)
{
+ if (!buf) {
+ return SERD_NODE_NULL;
+ }
+
uint32_t flags = 0;
size_t buf_n_bytes = 0;
const size_t buf_n_chars = serd_strlen(buf, &buf_n_bytes, &flags);