summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-04-27 00:30:33 +0000
committerDavid Robillard <d@drobilla.net>2014-04-27 00:30:33 +0000
commit88b95c5a431dfb2762309073184406d1eaa987bf (patch)
tree4cc555cda47eb50912678c1ae53a84ced26fc51e
parent9feff342144ac6a3c80f5e0ef9e53418f7299a83 (diff)
downloadlilv-88b95c5a431dfb2762309073184406d1eaa987bf.tar.gz
lilv-88b95c5a431dfb2762309073184406d1eaa987bf.tar.bz2
lilv-88b95c5a431dfb2762309073184406d1eaa987bf.zip
Tolerate calling lilv_node_as_uri or lilv_node_as_blank on NULL.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5375 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS3
-rw-r--r--src/node.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 1ba6f28..ccecf36 100644
--- a/NEWS
+++ b/NEWS
@@ -5,8 +5,9 @@ lilv (0.18.1) unstable;
* Fix minor memory leak in test suite
* Call lv2_lib_descriptor separately for different bundle paths
(fix loading several dynamic plugins like Ingen at once)
+ * Tolerate calling lilv_node_as_uri or lilv_node_as_blank on NULL
- -- David Robillard <d@drobilla.net> Fri, 17 Jan 2014 20:34:10 -0500
+ -- David Robillard <d@drobilla.net> Sat, 26 Apr 2014 20:29:27 -0400
lilv (0.18.0) stable;
diff --git a/src/node.c b/src/node.c
index 73dde29..e8756ac 100644
--- a/src/node.c
+++ b/src/node.c
@@ -296,8 +296,8 @@ LILV_API
const char*
lilv_node_as_uri(const LilvNode* value)
{
- assert(lilv_node_is_uri(value));
- return (const char*)sord_node_get_string(value->node);
+ assert(!value || lilv_node_is_uri(value));
+ return value ? (const char*)sord_node_get_string(value->node) : NULL;
}
const SordNode*
@@ -318,8 +318,8 @@ LILV_API
const char*
lilv_node_as_blank(const LilvNode* value)
{
- assert(lilv_node_is_blank(value));
- return (const char*)sord_node_get_string(value->node);
+ assert(!value || lilv_node_is_blank(value));
+ return value ? (const char*)sord_node_get_string(value->node) : NULL;
}
LILV_API