From 89543bf4db0dfb7a28343d46ad1211393980125e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Sep 2011 20:15:49 +0000 Subject: Fix assertion failure on clicking on bundles whose channels are all of the wrong type. git-svn-id: svn://localhost/ardour2/branches/3.0@10147 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gtk2_ardour/port_matrix.cc') diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index ae2b19075b..d7e2cfd7fa 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -379,11 +379,21 @@ PortMatrix::visible_rows () const return visible_ports (_row_index); } +/** @param column Column; its bundle may be 0 if we are over a row heading. + * @param row Row; its bundle may be 0 if we are over a column heading. + */ void PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t) { using namespace Menu_Helpers; + if ((row.bundle && row.bundle->nchannels().n_total() == 0) || (column.bundle && column.bundle->nchannels().n_total() == 0)) { + /* One of the bundles has no channels, which means that it has none of the appropriate type, + and is only being displayed to look pretty. So we don't need to do anything. + */ + return; + } + delete _menu; _menu = new Menu; -- cgit v1.2.3