the docshell doesn't like nil charsets, bulletproof the code a little

(bug 235639).


git-svn-id: svn://10.0.0.236/trunk@153340 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%aol.net 2004-02-27 18:49:01 +00:00
parent 27d7c8dc29
commit 310a6738a0

View File

@ -1204,7 +1204,7 @@ const char kDirServiceContractID[] = "@mozilla.org/file/directory_service;1";
{
// set charset on document then reload the page (hopefully not hitting the network)
nsCOMPtr<nsIDocCharset> charset ( do_QueryInterface([self getDocShell]) );
if ( charset ) {
if ( charset && inCharset ) {
charset->SetCharset([inCharset cString]);
[self reload:nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE];
}