From 23338fd1538c8ed9079404ed67bb70f199a87d6c Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Wed, 1 Jun 2005 22:39:35 +0000 Subject: [PATCH] bug 295531: Assert that we will have at least one node to paste. Triggering this assertion probably means the HTML parser is throwing away data. r=brade sr=smfr a=shaver git-svn-id: svn://10.0.0.236/trunk@173998 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp index 138cbc5399a..f2cb7ba3e9c 100644 --- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -219,7 +219,7 @@ NS_IMETHODIMP nsHTMLEditor::LoadHTML(const nsAString & aInputString) nsCOMPtr docfrag; { res = nsrange->CreateContextualFragment(aInputString, getter_AddRefs(docfrag)); - NS_ENSURE_SUCCESS(res, res); + NS_ENSURE_SUCCESS(res, res); } // put the fragment into the document nsCOMPtr parent, junk; @@ -387,6 +387,8 @@ nsHTMLEditor::InsertHTMLWithContext(const nsAString & aInputString, streamEndParent, streamEndOffset); NS_ENSURE_SUCCESS(res, res); + NS_ASSERTION(nodeList.Count() > 0, "We should have at least one node here."); + // walk list of nodes; perform surgery on nodes (relativize) with _mozattr res = RelativizeURIInFragmentList(nodeList, aFlavor, aSourceDoc, targetNode); // ignore results from this call, try to paste/insert anyways