From e04c114e90b37ff7ed6a479205875616e6afce1f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 17 Nov 2012 21:33:42 +0000 Subject: Gracefully ignore plugins with invalid ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4826 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/BlockFactory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp index 9ae1fddb..484e0c63 100644 --- a/src/server/BlockFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -18,6 +18,7 @@ #include "lilv/lilv.h" +#include "ingen/Log.hpp" #include "ingen/World.hpp" #include "internals/Controller.hpp" #include "internals/Delay.hpp" @@ -120,8 +121,12 @@ BlockFactory::load_lv2_plugins() const LilvPlugins* plugins = lilv_world_get_all_plugins(_world->lilv_world()); LILV_FOREACH(plugins, i, plugins) { const LilvPlugin* lv2_plug = lilv_plugins_get(plugins, i); - - const Raul::URI uri(lilv_node_as_uri(lilv_plugin_get_uri(lv2_plug))); + const Raul::URI uri(lilv_node_as_uri(lilv_plugin_get_uri(lv2_plug))); + if (!lilv_plugin_get_port_by_index(lv2_plug, 0)) { + _world->log().warn( + Raul::fmt("Ignoring plugin <%1%> with invalid ports\n") % uri); + continue; + } if (_plugins.find(uri) != _plugins.end()) { continue; -- cgit v1.2.1