we need to watch the error code of content type

This commit is contained in:
valeski%netscape.com 1999-06-29 23:26:11 +00:00
Родитель fe1091d59e
Коммит 5756abe1b0
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);