MainForm - Fix duplicating folder when dropping onto itself

This commit is contained in:
miku-666
2024-05-08 16:44:33 +02:00
parent 4a856deca5
commit 70d83eca2a

View File

@@ -1466,10 +1466,16 @@ namespace PckStudio
return;
bool isTargetPckFile = targetNode.IsTagOfType<PckAsset>();
if (e.Data.GetData(dataFormat) is not TreeNode draggedNode)
TreeNode draggedNode = e.Data.GetData(dataFormat) as TreeNode;
if (draggedNode == null)
{
Debug.WriteLine("Dragged data was not of type TreeNode.");
Debug.WriteLine("Dragged node is null.");
return;
}
if (targetNode.Equals(draggedNode))
{
Debug.WriteLine("Dragged node was not moved.");
return;
}