From 18949858d9710196c64d484b8cc621c4dc78adc2 Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Fri, 13 Nov 2020 15:21:43 +0100
Subject: Fix test coverage

---
 src/env.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

(limited to 'src')

diff --git a/src/env.c b/src/env.c
index ac081ee0..843db088 100644
--- a/src/env.c
+++ b/src/env.c
@@ -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*
-- 
cgit v1.2.1