Don't crash when ParseFragment() is called with an empty |aTagStack|. b=403877 r+sr=mrbkap a=jonas

This commit is contained in:
mats.palmgren@bredband.net 2007-11-16 15:56:51 -08:00
parent 716914ef1e
commit c1be16ac17

View File

@ -1453,7 +1453,7 @@ nsParser::ParseFragment(const nsAString& aSourceBuffer,
nsCOMPtr<nsIFragmentContentSink> fragSink = do_QueryInterface(mSink);
NS_ASSERTION(fragSink, "ParseFragment requires a fragment content sink");
if (!aXMLMode) {
if (!aXMLMode && theCount) {
// First, we have to flush any tags that don't belong in the head if there
// was no <body> in the context.
// XXX This is extremely ugly. Maybe CNavDTD should have FlushMisplaced()?