Exception when pasting/duplicating a freehand drawn object

Description

To reproduce:

  1. Make a screenshot

  2. Use the Draw freehand tool to draw a curve

    1. Ctrl+C then Ctrl+V the curve that was just created. Result: InvalidCastException (see details below)

    2. Right-click the curve and select "Duplicate selected item". Result: ArgumentNullException (see details below)

InvalidCastException (when copy/pasting)

Software version: 1.2.10.6-RELEASE-c2414cf0149a1475ea00520effc01b40087c225c (64 bit) .NET runtime version: 4.0.30319.42000+ Time: 2021-05-13 09:59:03 -05:00 OS: unknown (x64) 10.0 build 18363 revision 0 GDI object count: 170 User object count: 118 Exception: System.InvalidCastException Message: Unable to cast object of type 'System.IO.MemoryStream' to type 'Greenshot.Plugin.Drawing.IDrawableContainerList'. Stack: at Greenshot.Drawing.Surface.PasteElementFromClipboard() at Greenshot.ImageEditorForm.PasteToolStripMenuItemClick(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData) at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut) at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData) at Greenshot.ImageEditorForm.ProcessCmdKey(Message& msg, Keys keys) at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData) at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData) at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData) at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData) at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) Configuration dump:

ArgumentNullException (when duplicating)

Software version: 1.2.10.6-RELEASE-c2414cf0149a1475ea00520effc01b40087c225c (64 bit) .NET runtime version: 4.0.30319.42000+ Time: 2021-05-13 09:59:27 -05:00 OS: unknown (x64) 10.0 build 18363 revision 0 GDI object count: 172 User object count: 121 Exception: System.ArgumentNullException Message: Value cannot be null. Stack: at System.Threading.Monitor.Enter(Object obj) at Greenshot.Drawing.FreehandContainer.RecalculatePath() at Greenshot.Drawing.DrawableContainer.OnDeserializedInit(StreamingContext context) at System.Runtime.Serialization.SerializationEventHandler.Invoke(StreamingContext context) at System.Runtime.Serialization.ObjectManager.RaiseDeserializationEvent() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) at GreenshotPlugin.Core.ObjectExtensions.Clone[T](T source) at Greenshot.Drawing.DrawableContainerList.<>c__DisplayClass35_0.<AddContextMenuItems>b__4(Object <sender>, EventArgs <e>) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Configuration dump:

Environment

Windows 10

Attachments

1
  • 13 May 2021, 03:00 PM

Activity

Show:

Jens Klingen May 14, 2021 at 7:14 PM

Thanks for reporting this. This issue has already been fixed for the upcoming version (Greenshot 1.3)

If you don’t want to wait for the final release, you can try the latest relese from our version history page.

Fixed

Details

Assignee

Reporter

Affects versions

Components

Priority

Created May 13, 2021 at 3:01 PM
Updated June 23, 2021 at 4:18 PM
Resolved May 14, 2021 at 7:17 PM