From cbe838ce2626cac50ab050f115a50ce4e5152a8a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 17 Dec 2024 15:48:12 +0100 Subject: [PATCH] Fix crash when dragging plugins from sidebar --- gtk2_ardour/processor_box.cc | 4 ++++ gtk2_ardour/region_editor.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index e1d65404d7..c1865d577c 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -2155,6 +2155,10 @@ not match the configuration of this track."); bool ProcessorBox::drag_refuse (DnDVBox* source, ProcessorEntry*) { + if (!source) { + /* handle drag from sidebar */ + return false; + } ProcessorBox* other = reinterpret_cast (source->get_data ("processorbox")); return (other && other->_route == _route); } diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 97e928a90f..bdd3772565 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -937,6 +937,9 @@ RegionEditor::RegionFxBox::delete_dragged_plugins (Region::RegionFxList const& f bool RegionEditor::RegionFxBox::drag_refuse (Gtkmm2ext::DnDVBox* source, RegionFxEntry*) { + if (!source) { + return false; + } RegionFxBox* other = reinterpret_cast (source->get_data ("regionfxbox")); return (other && other->_region == _region); }