mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1520812. Remove bogus assertion in nsExpatDriver::HandleError. r=hsivonen
Any time we stop a load of an XML document before we've gotten all the data, we'll end up in this code with mSink null, because nsParser::Terminate ends up calling nsExpatDriver::DidBuildModel which nulls out mSink, and not getting all the data means the XML won't be well-formed. Differential Revision: https://phabricator.services.mozilla.com/D16856 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
5e4c79d90d
commit
eb529dfa42
@ -732,8 +732,6 @@ nsresult nsExpatDriver::HandleError() {
|
||||
CreateErrorText(description.get(), XML_GetBase(mExpatParser), lineNumber,
|
||||
colNumber, errorText);
|
||||
|
||||
NS_ASSERTION(mSink, "no sink?");
|
||||
|
||||
nsAutoString sourceText(mLastLine);
|
||||
AppendErrorPointer(colNumber, mLastLine.get(), sourceText);
|
||||
|
||||
@ -749,6 +747,7 @@ nsresult nsExpatDriver::HandleError() {
|
||||
// If it didn't initialize, we can't do any logging.
|
||||
bool shouldReportError = NS_SUCCEEDED(rv);
|
||||
|
||||
// mSink might be null here if our parser was terminated.
|
||||
if (mSink && shouldReportError) {
|
||||
rv = mSink->ReportError(errorText.get(), sourceText.get(), serr,
|
||||
&shouldReportError);
|
||||
@ -757,6 +756,7 @@ nsresult nsExpatDriver::HandleError() {
|
||||
}
|
||||
}
|
||||
|
||||
// mOriginalSink might be null here if our parser was terminated.
|
||||
if (mOriginalSink) {
|
||||
nsCOMPtr<Document> doc = do_QueryInterface(mOriginalSink->GetTarget());
|
||||
if (doc && doc->SuppressParserErrorConsoleMessages()) {
|
||||
|
@ -1,2 +0,0 @@
|
||||
[bailout-exception-vs-return-xml.window.html]
|
||||
max-asserts: 2
|
Loading…
x
Reference in New Issue
Block a user