diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 58f66fcd8a..1ccdbec4d7 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1781,13 +1781,19 @@ Editor::add_region_context_items (StreamView* sv, list } if (ar) { + /* its a bit unfortunate that "envelope visible" is a view-only + property. we have to find the regionview to able to check + its current setting. + */ + RegionView* rv = sv->find_view (ar); - AudioRegionView* arv = dynamic_cast (rv); - - if (rv && arv && arv->envelope_visible()) { - have_envelope_visible = true; - } else { - have_envelope_invisible = true; + have_envelope_invisible = true; + + if (rv) { + AudioRegionView* arv = dynamic_cast (rv); + if (arv && arv->envelope_visible()) { + have_envelope_visible = true; + } } if (ar->envelope_active()) {