diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
index fe068e4de..9227dac06 100644
--- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
@@ -209,16 +209,15 @@ namespace FlaxEditor.CustomEditors.Dedicated
public override DragDropEffect OnDragMove(ref Float2 location, DragData data)
{
var result = base.OnDragMove(ref location, data);
- if (result != DragDropEffect.None)
+ if (result != DragDropEffect.None || _dragHandlers == null)
return result;
-
return _dragHandlers.Effect;
}
///
public override void OnDragLeave()
{
- _dragHandlers.OnDragLeave();
+ _dragHandlers?.OnDragLeave();
base.OnDragLeave();
}
diff --git a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
index 41715d654..d7d16083e 100644
--- a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
@@ -585,7 +585,7 @@ namespace FlaxEditor.CustomEditors.Editors
public override DragDropEffect OnDragMove(ref Float2 location, DragData data)
{
var result = base.OnDragMove(ref location, data);
- if (result != DragDropEffect.None)
+ if (result != DragDropEffect.None || _dragHandlers == null)
return result;
return _dragHandlers.Effect;
@@ -594,7 +594,7 @@ namespace FlaxEditor.CustomEditors.Editors
///
public override void OnDragLeave()
{
- _dragHandlers.OnDragLeave();
+ _dragHandlers?.OnDragLeave();
base.OnDragLeave();
}