Bug 808313 - changing location.protocol can break nsFtpState::Init r=jduell

This commit is contained in:
Reed Loden 2012-11-03 15:53:00 -07:00
parent 0c1158c097
commit a8bd02a2f4

View File

@ -1681,15 +1681,19 @@ nsFtpState::Init(nsFtpChannel *channel)
mAction = PUT;
nsresult rv;
nsAutoCString path;
nsCOMPtr<nsIURL> url = do_QueryInterface(mChannel->URI());
nsCString host;
url->GetAsciiHost(host);
if (host.IsEmpty()) {
nsAutoCString host;
if (url) {
rv = url->GetAsciiHost(host);
} else {
rv = mChannel->URI()->GetAsciiHost(host);
}
if (NS_FAILED(rv) || host.IsEmpty()) {
return NS_ERROR_MALFORMED_URI;
}
nsAutoCString path;
if (url) {
rv = url->GetFilePath(path);
} else {