From a10d27f2c1fff0162f82e1c64ad41a28cb02e51b Mon Sep 17 00:00:00 2001 From: glopesdev Date: Fri, 26 Apr 2024 15:50:27 +0100 Subject: [PATCH] Ensure dragged nodes have content --- Bonsai.Editor/EditorForm.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bonsai.Editor/EditorForm.cs b/Bonsai.Editor/EditorForm.cs index 3f2d9d75..06f5fa39 100644 --- a/Bonsai.Editor/EditorForm.cs +++ b/Bonsai.Editor/EditorForm.cs @@ -1541,7 +1541,9 @@ protected override void OnDeactivate(EventArgs e) private void toolboxTreeView_ItemDrag(object sender, ItemDragEventArgs e) { - if (e.Item is TreeNode selectedNode && selectedNode.GetNodeCount(false) == 0) + if (e.Item is TreeNode selectedNode && + selectedNode.Tag is not null && + selectedNode.GetNodeCount(false) == 0) { toolboxTreeView.DoDragDrop(selectedNode, DragDropEffects.Copy); }