Exception when moving node out of region

Happens in 5.2-11

To reproduce - just put any node into a ForEach and try to move it out of the region.

InvalidCastException: "Unable to cast object of type 'VL.Model.Patch' to type 'VL.Model.Document'."
    StackTrace:
        System.Runtime.CompilerServices.CastHelpers { private static object ChkCast_Helper(System.Void* toTypeHnd, object obj) { ... } } 
        VL.Model.Internal.NugetDependency { internal virtual VL.Model.Element CreateRed(VL.Model.Compound parent, VL.Model.Element previous, bool inBatchUpdate) { ... } } 
        VL.Model.Compound { private System.Collections.Immutable.ImmutableArray<VL.Model.Element> GetChildren() { ... } } 
        VL.Model.Compound+<GetDescendents>d__21 { private virtual bool MoveNext() { ... } } 
        System.Linq.Enumerable+WhereEnumerableIterator`1 { public virtual bool MoveNext() { ... } } 
        VL.Model.ModelExtensions { public static System.Collections.Generic.HashSet<VL.Model.Element> Reduce(System.Collections.Generic.IEnumerable<VL.Model.Element> elements) { ... } } 
        VL.Model.ModelExtensions { public static TContainer RemoveDescendents(TContainer container, System.Collections.Generic.IEnumerable<VL.Model.Element> descendents) { ... } } 
        VL.Model.ModelExtensions { public static VL.Model.Compound Insert(VL.Model.Compound destination, System.Collections.Generic.IEnumerable<VL.Model.Element> elements) { ... } } 
        VL.Lang.View.CanvasView+MoveSelectedMouseHandler { protected virtual VL.Core.Viewer.IMouseEventHandler MouseDrag(VL.Core.Viewer.VMouseEventArgs arg, System.Drawing.PointF delta, System.Drawing.PointF worldDelta) { ... } } 
        VL.Lang.View.MouseHandlerBase`1 { public virtual VL.Core.Viewer.IMouseEventHandler MouseMove(VL.Core.Viewer.VMouseEventArgs arg) { ... } } 
        VL.Core.Viewer.Handler+ParallelMouseHandler { public virtual VL.Core.Viewer.IMouseEventHandler MouseMove(VL.Core.Viewer.VMouseEventArgs arg) { ... } } 
        VL.Lang.View.CanvasView+CanvasDecisionMouseHandler { public virtual VL.Core.Viewer.IMouseEventHandler MouseMove(VL.Core.Viewer.VMouseEventArgs arg) { ... } } 
        VL.Lang.View.CanvasView { private void HandleMouseMove(object sender, VL.Core.Viewer.VMouseEventArgs e) { ... } } 
        System.Windows.Forms.Control { protected virtual void WndProc(System.Windows.Forms.Message& m) { ... } } 
        System.Windows.Forms.ScrollableControl { protected virtual void WndProc(System.Windows.Forms.Message& m) { ... } } 
        VL.Skia.SkiaGLControl { protected virtual void WndProc(System.Windows.Forms.Message& m) { ... } } 

This should be fixed in the latest (5.2-16)

1 Like