diff options
-rw-r--r-- | src/env.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -115,8 +115,12 @@ SerdStatus serd_env_set_base_uri(SerdEnv* env, const SerdNode* uri) { - if (!env || !uri || uri->type != SERD_URI) { + if (!env || (uri && uri->type != SERD_URI)) { return SERD_ERR_BAD_ARG; + } else if (!uri) { + serd_node_free(env->base_uri_node); + env->base_uri_node = NULL; + env->base_uri = SERD_URI_NULL; } // Resolve base URI and create a new node and URI for it |