Crash on cut and paste - InvalidOperationException: Token EndElement in state TopLevel would result in an invalid XML document.

Crashes when copy and pasting.  IE v11 is installed with the latest updates. I checked that the clipboard access setting (or whatever it is called) in IE security options was enabled, but that didn’t help.

EDIT: This is not happening on a specific email, but fairly often with a variety of different emails.

eM Client (6.0.23181.0)Windows: Microsoft Windows NT 6.2.9200.0, Framework: 4.0.30319.42000
The following error has occurred:
System.InvalidOperationException: Token EndElement in state TopLevel would result in an invalid XML document.
   at System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(Token token, State currentState)
   at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
   at System.Xml.XmlWellFormedWriter.WriteFullEndElement()
   at MailClient.Utils.HtmlStyleWrapper.WriteShallowNode(XmlReader reader, XmlWriter writer)
   at MailClient.Utils.HtmlStyleWrapper.ProcessHtml(TextReader input, TextWriter outputWriter, TextWriter styleWriter, String wrappingTag)
   at MailClient.Utils.HtmlStyleWrapper.ProcessHtml(TextReader input, StringBuilder outputBuilder, StringBuilder styleBuilder, String wrappingTag)
   at MailClient.Utils.Text.GetFilteredHtmlFromClipboard(String context, String& css)
   at MailClient.UI.Forms.formSendMail.HtmlEditor_Paste(Object sender, PasteEventArgs e)
   at Microsoft.ConsultingServices.HtmlEditor.HtmlEditorControl.TextPaste()
   at MailClient.UI.Forms.formSendMail.pasteToolStripMenuItem_Click(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.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   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.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at MailClient.Program.b__4()
at MailClient.ExceptionUtils.ExceptionUtils.Filter(BodyDelegate body, FilterDelegate filter, Action`1 handler)


http://emclient.com/ns/report">

eM Client
6.0.23181.0

false

Microsoft Windows NT 6.2.9200.0
4.0.30319.42000


System.InvalidOperationException
Token EndElement in state TopLevel would result in an invalid XML document.
System.Xml




System.Xml.dll
100666968
System.Xml
System.Xml.XmlWellFormedWriter
ThrowInvalidStateTransition


System.Xml
System.Xml.XmlWellFormedWriter+Token
token


System.Xml
System.Xml.XmlWellFormedWriter+State
currentState



57
ef




System.Xml.dll
100666960
System.Xml
System.Xml.XmlWellFormedWriter
AdvanceState


System.Xml
System.Xml.XmlWellFormedWriter+Token
token



0
52a36f




System.Xml.dll
100666914
System.Xml
System.Xml.XmlWellFormedWriter
WriteFullEndElement


b8
10c




MailClient.exe
100689822
MailClient
MailClient.Utils.HtmlStyleWrapper
WriteShallowNode


System.Xml
System.Xml.XmlReader
reader


System.Xml
System.Xml.XmlWriter
writer



138
1b6




MailClient.exe
100689818
MailClient
MailClient.Utils.HtmlStyleWrapper
ProcessHtml


mscorlib
System.IO.TextReader
input


mscorlib
System.IO.TextWriter
outputWriter


mscorlib
System.IO.TextWriter
styleWriter


mscorlib
System.String
wrappingTag



135
394




MailClient.exe
100689817
MailClient
MailClient.Utils.HtmlStyleWrapper
ProcessHtml


mscorlib
System.IO.TextReader
input


mscorlib
System.Text.StringBuilder
outputBuilder


mscorlib
System.Text.StringBuilder
styleBuilder


mscorlib
System.String
wrappingTag



e
43




MailClient.exe
100695436
MailClient
MailClient.Utils.Text
GetFilteredHtmlFromClipboard


mscorlib
System.String
context


mscorlib
System.String&
css



2d
ca




MailClient.exe
100693611
MailClient
MailClient.UI.Forms.formSendMail
HtmlEditor_Paste


mscorlib
System.Object
sender


HTMLEditorControl
Microsoft.ConsultingServices.HtmlEditor.HtmlEditorControl+PasteEventArgs
e



114
22f




HTMLEditorControl.dll
100663736
HTMLEditorControl
Microsoft.ConsultingServices.HtmlEditor.HtmlEditorControl
TextPaste


e
34




MailClient.exe
100693672
MailClient
MailClient.UI.Forms.formSendMail
pasteToolStripMenuItem_Click


mscorlib
System.Object
sender


mscorlib
System.EventArgs
e



0
1a




System.Windows.Forms.dll
100679150
System.Windows.Forms
System.Windows.Forms.ToolStripItem
RaiseEvent


mscorlib
System.Object
key


mscorlib
System.EventArgs
e



15
6d




System.Windows.Forms.dll
100679466
System.Windows.Forms
System.Windows.Forms.ToolStripMenuItem
OnClick


mscorlib
System.EventArgs
e



17
45




System.Windows.Forms.dll
100679085
System.Windows.Forms
System.Windows.Forms.ToolStripItem
HandleClick


mscorlib
System.EventArgs
e



3b
c3




System.Windows.Forms.dll
100679094
System.Windows.Forms
System.Windows.Forms.ToolStripItem
HandleMouseUp


System.Windows.Forms
System.Windows.Forms.MouseEventArgs
e



c6
201




System.Windows.Forms.dll
100679071
System.Windows.Forms
System.Windows.Forms.ToolStripItem
FireEventInteractive


mscorlib
System.EventArgs
e


System.Windows.Forms
System.Windows.Forms.ToolStripItemEventType
met



46
88




System.Windows.Forms.dll
100679070
System.Windows.Forms
System.Windows.Forms.ToolStripItem
FireEvent


mscorlib
System.EventArgs
e


System.Windows.Forms
System.Windows.Forms.ToolStripItemEventType
met



c9
8eaa28




System.Windows.Forms.dll
100678108
System.Windows.Forms
System.Windows.Forms.ToolStrip
OnMouseUp


System.Windows.Forms
System.Windows.Forms.MouseEventArgs
mea



6f
b1




System.Windows.Forms.dll
100678627
System.Windows.Forms
System.Windows.Forms.ToolStripDropDown
OnMouseUp


System.Windows.Forms
System.Windows.Forms.MouseEventArgs
mea



0
23




System.Windows.Forms.dll
100666899
System.Windows.Forms
System.Windows.Forms.Control
WmMouseUp


System.Windows.Forms
System.Windows.Forms.Message&
m


System.Windows.Forms
System.Windows.Forms.MouseButtons
button


mscorlib
System.Int32
clicks



184
27e




System.Windows.Forms.dll
100666915
System.Windows.Forms
System.Windows.Forms.Control
WndProc


System.Windows.Forms
System.Windows.Forms.Message&
m



62f
911d5c




System.Windows.Forms.dll
100676291
System.Windows.Forms
System.Windows.Forms.ScrollableControl
WndProc


System.Windows.Forms
System.Windows.Forms.Message&
m



34
2f




System.Windows.Forms.dll
100678159
System.Windows.Forms
System.Windows.Forms.ToolStrip
WndProc


System.Windows.Forms
System.Windows.Forms.Message&
m



e3
49




System.Windows.Forms.dll
100678658
System.Windows.Forms
System.Windows.Forms.ToolStripDropDown
WndProc


System.Windows.Forms
System.Windows.Forms.Message&
m



71
35




System.Windows.Forms.dll
100684755
System.Windows.Forms
System.Windows.Forms.Control+ControlNativeWindow
OnMessage


System.Windows.Forms
System.Windows.Forms.Message&
m



0
12




System.Windows.Forms.dll
100684758
System.Windows.Forms
System.Windows.Forms.Control+ControlNativeWindow
WndProc


System.Windows.Forms
System.Windows.Forms.Message&
m



8e
34




System.Windows.Forms.dll
100674652
System.Windows.Forms
System.Windows.Forms.NativeWindow
DebuggableCallback


mscorlib
System.IntPtr
hWnd


mscorlib
System.Int32
msg


mscorlib
System.IntPtr
wparam


mscorlib
System.IntPtr
lparam



25
5d




System.Windows.Forms.dll
100681123
System.Windows.Forms
System.Windows.Forms.UnsafeNativeMethods
DispatchMessageW


System.Windows.Forms
System.Windows.Forms.NativeMethods+MSG&
msg



ffffffff
0




System.Windows.Forms.dll
100684322
System.Windows.Forms
System.Windows.Forms.Application+ComponentManager
System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop


mscorlib
System.IntPtr
dwComponentID


mscorlib
System.Int32
reason


mscorlib
System.Int32
pvLoopData



173
24c




System.Windows.Forms.dll
100684368
System.Windows.Forms
System.Windows.Forms.Application+ThreadContext
RunMessageLoopInner


mscorlib
System.Int32
reason


System.Windows.Forms
System.Windows.Forms.ApplicationContext
context



1df
154




System.Windows.Forms.dll
100684367
System.Windows.Forms
System.Windows.Forms.Application+ThreadContext
RunMessa

Hi Joshua,
could you please tell me which version of eM Client you’re running?
Also, does this happen when you copy and paste using the right-mouse button, when using shortcuts Ctrl+V and Ctrl+C or during both?

Best regards,
Olivia

Both mouse and keyboard. Version number is right there at the top of the error log.

Nothing? You’re losing a potential pro version customer by not responding to these issues.

Hi Joshua,
sorry for the late reply. I see that you aren’t running the lates update. Have you tried updating to the latest release and see if the issue persists?

Best regards,
Olivia