diff options
author | David Robillard <d@drobilla.net> | 2020-11-13 15:21:43 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-13 15:21:43 +0100 |
commit | 18949858d9710196c64d484b8cc621c4dc78adc2 (patch) | |
tree | f9c6f8e6296edf002dfc5778b745ea53ae82f244 /src | |
parent | d63f832e64b8b7faf14575584e356533be349280 (diff) | |
download | serd-18949858d9710196c64d484b8cc621c4dc78adc2.tar.gz serd-18949858d9710196c64d484b8cc621c4dc78adc2.tar.bz2 serd-18949858d9710196c64d484b8cc621c4dc78adc2.zip |
Fix test coverage
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -76,7 +76,7 @@ serd_env_set_base_uri(SerdEnv* env, { if (!env || (uri && uri->type != SERD_URI)) { return SERD_ERR_BAD_ARG; - } else if (!uri) { + } else if (!uri || !uri->buf) { serd_node_free(&env->base_uri_node); env->base_uri_node = SERD_NODE_NULL; env->base_uri = SERD_URI_NULL; @@ -88,14 +88,12 @@ serd_env_set_base_uri(SerdEnv* env, SerdNode base_uri_node = serd_node_new_uri_from_node( uri, &env->base_uri, &base_uri); - if (base_uri_node.buf) { - // Replace the current base URI - serd_node_free(&env->base_uri_node); - env->base_uri_node = base_uri_node; - env->base_uri = base_uri; - return SERD_SUCCESS; - } - return SERD_ERR_BAD_ARG; + // Replace the current base URI + serd_node_free(&env->base_uri_node); + env->base_uri_node = base_uri_node; + env->base_uri = base_uri; + + return SERD_SUCCESS; } static inline SERD_PURE_FUNC SerdPrefix* |