From 795c2de0ec825c173c0a858c503a85456bc97558 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 14 Jun 2009 23:39:21 +0000 Subject: Tolerate LV2 plugins without a binary URI. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2109 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/LV2Plugin.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/engine') 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; } -- cgit v1.2.1