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); }