From 00f19d472dc8b21d8abe78b32e44ec2868ea4e49 Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Tue, 29 Jun 1999 23:26:11 +0000 Subject: [PATCH] we need to watch the error code of content type git-svn-id: svn://10.0.0.236/trunk@37493 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsParser.cpp | 5 ++++- mozilla/parser/htmlparser/src/nsParser.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index 2740b37afb4..7cdcf86c2af 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -1058,7 +1058,10 @@ nsresult nsParser::OnStartBinding(nsIURI* aURL, const char *aSourceType) rv = aContext->QueryInterface(nsIChannel::GetIID(), (void**)&channel); if (NS_SUCCEEDED(rv)) { char* contentType; - (void)channel->GetContentType(&contentType); // XXX ignore error? + rv = channel->GetContentType(&contentType); + if (NS_FAILED(rv)) { + NS_ASSERTION(contentType, "parser needs a content type to find a dtd"); + } mParserContext->mSourceType = contentType; nsCRT::free(contentType); NS_RELEASE(channel); diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index 2740b37afb4..7cdcf86c2af 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -1058,7 +1058,10 @@ nsresult nsParser::OnStartBinding(nsIURI* aURL, const char *aSourceType) rv = aContext->QueryInterface(nsIChannel::GetIID(), (void**)&channel); if (NS_SUCCEEDED(rv)) { char* contentType; - (void)channel->GetContentType(&contentType); // XXX ignore error? + rv = channel->GetContentType(&contentType); + if (NS_FAILED(rv)) { + NS_ASSERTION(contentType, "parser needs a content type to find a dtd"); + } mParserContext->mSourceType = contentType; nsCRT::free(contentType); NS_RELEASE(channel);