summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-14 23:39:21 +0000
committerDavid Robillard <d@drobilla.net>2009-06-14 23:39:21 +0000
commit795c2de0ec825c173c0a858c503a85456bc97558 (patch)
treeb0ae545ada6bf1cf68e722b84a4d6ad3d854eb82 /src
parent3c30e2d37a829d603ab309fa2033610a17d8f0ef (diff)
downloadingen-795c2de0ec825c173c0a858c503a85456bc97558.tar.gz
ingen-795c2de0ec825c173c0a858c503a85456bc97558.tar.bz2
ingen-795c2de0ec825c173c0a858c503a85456bc97558.zip
Tolerate LV2 plugins without a binary URI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2109 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/engine/LV2Plugin.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/engine/LV2Plugin.cpp b/src/engine/LV2Plugin.cpp
index 0736dfcb..7b289c32 100644
--- a/src/engine/LV2Plugin.cpp
+++ b/src/engine/LV2Plugin.cpp
@@ -92,9 +92,16 @@ LV2Plugin::slv2_plugin(SLV2Plugin p)
const std::string&
LV2Plugin::library_path() const
{
- if (_library_path == "")
- _library_path = slv2_uri_to_path(slv2_value_as_uri(
- slv2_plugin_get_library_uri(_slv2_plugin)));
+ static const std::string empty_string;
+ if (_library_path == "") {
+ SLV2Value v = slv2_plugin_get_library_uri(_slv2_plugin);
+ if (v) {
+ _library_path = slv2_uri_to_path(slv2_value_as_uri(v));
+ } else {
+ cerr << "WARNING: Plugin " << uri() << " has no library path" << endl;
+ return empty_string;
+ }
+ }
return _library_path;
}