aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/node.c b/src/node.c
index d20fbb1f..9851a6a7 100644
--- a/src/node.c
+++ b/src/node.c
@@ -359,14 +359,22 @@ serd_node_resolve(const SerdNode* node, const SerdNode* base)
SerdNode*
serd_new_resolved_uri_i(const char* str, const SerdURI* base)
{
+ SerdNode* result = NULL;
if (!str || str[0] == '\0') {
// Empty URI => Base URI, or nothing if no base is given
- return base ? serd_new_from_uri(base, NULL) : NULL;
+ result = base ? serd_new_from_uri(base, NULL) : NULL;
+ } else {
+ SerdURI uri;
+ serd_uri_parse(str, &uri);
+ result = serd_new_from_uri(&uri, base);
}
- SerdURI uri;
- serd_uri_parse(str, &uri);
- return serd_new_from_uri(&uri, base);
+ if (!serd_uri_string_has_scheme(serd_node_get_string(result))) {
+ serd_node_free(result);
+ return NULL;
+ }
+
+ return result;
}
static inline bool