summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PluginUI.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 3a3b3270..74d87a13 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -53,7 +53,14 @@ lv2_ui_write(LV2UI_Controller controller,
PluginUI* ui = (PluginUI*)controller;
- SharedPtr<PortModel> port = ui->node()->ports()[port_index];
+ NodeModel::Ports ports = ui->node()->ports();
+ if (port_index >= ports.size()) {
+ error << "UI for " << ui->node()->plugin()->uri()
+ << " tried to write to non-existent port " << port_index << endl;
+ return;
+ }
+
+ SharedPtr<PortModel> port = ports[port_index];
const Shared::LV2URIMap& uris = *ui->world()->uris().get();