Fix potential exception in drag and drop handling

This commit is contained in:
Wojtek Figat
2023-10-03 22:20:44 +02:00
parent 167fead18d
commit 4e83a0a757

View File

@@ -68,7 +68,7 @@ namespace FlaxEditor.Content.GUI
_validDragOver = true; _validDragOver = true;
result = DragDropEffect.Copy; result = DragDropEffect.Copy;
} }
else if (_dragActors.HasValidDrag) else if (_dragActors != null && _dragActors.HasValidDrag)
{ {
_validDragOver = true; _validDragOver = true;
result = DragDropEffect.Move; result = DragDropEffect.Move;
@@ -94,7 +94,7 @@ namespace FlaxEditor.Content.GUI
result = DragDropEffect.Copy; result = DragDropEffect.Copy;
} }
// Check if drop actor(s) // Check if drop actor(s)
else if (_dragActors.HasValidDrag) else if (_dragActors != null && _dragActors.HasValidDrag)
{ {
// Import actors // Import actors
var currentFolder = Editor.Instance.Windows.ContentWin.CurrentViewFolder; var currentFolder = Editor.Instance.Windows.ContentWin.CurrentViewFolder;